text of lowercase English letters. A streak is a run of identical letters standing next to each other.
Return the length of the longest streak. A single letter on its own counts as a streak of length 1.text="zzzzaaabzzz" → 4
The longest streak is the four z's at the start; the three a's and the trailing z's are shorter.
text="moon" → 2
Only the two o's stand next to each other.
text="q" → 1
text consists of lowercase English letterstext="zzzzaaabzzz"
4
Run checks the first 3 tests in your browser. Submit checks all 73 tests on the server, hidden ones included.