log, a string of lowercase English letters. Equal letters standing next to each other form a streak: for example, "ttrooooe" consists of the streaks "tt", "r", "oooo" and "e".
A streak is long if it has at least three letters. For every long streak, return the pair [start, end]: the indices of its first and last letter (0-based). List the pairs in the order the streaks appear in the string.log="kkkpqqqqzx" → [[0, 2], [4, 7]]
The streak kkk covers indices 0–2 and qqqq covers 4–7. The other letters stand alone.
log="aabbaa" → []
Every streak has length 2, so there are no long ones and the answer is empty.
log="mmm" → [[0, 2]]
log consists of lowercase English letters onlylog="kkkpqqqqzx"
[[0, 2], [4, 7]]
Run checks the first 3 tests in your browser. Submit checks all 56 tests on the server, hidden ones included.