text of lowercase English letters. Look at every run of exactly three consecutive characters in it: the one starting at the first letter, the one starting at the second, and so on.
Count how many of these runs have three different letters. Equal runs at different positions are counted separately.text='banana' → 1
The three-letter windows are "ban", "ana", "nan" and "ana". Only "ban" has all different letters.
text='planet' → 4
All four windows, "pla", "lan", "ane" and "net", have no repeats.
text='ok' → 0
The string is shorter than three letters, so there are no windows.
text.length ≤ 100text consists of lowercase English letters onlytext='banana'
1
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.