Narrative Words π₯
In the narrative of a sentence filled with words, your quest is to seek out those special words that hold a secret: they contain triple repeating letters, where the same letter appears at least three times consecutively. Each word in the sentence is a sequence of English letters bordered by whitespace characters.
As you embark on this linguistic adventure, remember that letters are to be counted regardless of their case. Your task is not to find the most efficient solution, but one that explores the sentence with a time complexity no worse than O(sentence.length * longestWord.length), ensuring it fits within the constraints of time.
The function narrativeWords awaits your guidance. It takes the sentence as input and returns the count of words harboring at least one letter that appears three times consecutively.
For original prompt, pls refer to source images ΰͺββ΄
π Credit to Λκ°αrobotΰ»κ±Λ π
1Example 1
Constraints
Limits and guarantees your solution can rely on.
Unknown for now