FastPrepNarrative Words πŸ₯

Narrative Words πŸ₯

The Trade Desk logoThe Trade Desk● EasyOA
Learn

Problem statement

Given a sentence words, count how many words contain at least one English letter that appears three or more times anywhere in that word. The repeated occurrences do not need to be consecutive.

Words consist of English letters and are separated by whitespace. Count letters case-insensitively.

Return the number of qualifying words.

Function

narrativeWords(words: String) β†’ int

Examples

Example 1

words = "Dooddle moodle Pepper unsuccessfully"return = 3

Dooddle has three occurrences of d, Pepper has three occurrences of p, and unsuccessfully has a letter occurring at least three times. moodle does not qualify.

Constraints

  • Unknown for now

More The Trade Desk problems

See The Trade Desk hiring insights
public int narrativeWords(String words) {
  // write your code here
}
words"Dooddle moodle Pepper unsuccessfully"
expected3
Checking account…