Longest Run of One Letter
Find the length of the longest block of consecutive equal characters.
Input: one line with the string S.
Output: the maximum run length.
Constraints:
- 1 ≤ |S| ≤ 104
- S contains lowercase English letters
Sample Tests
Input 1
aabbbcc
Output 1
3
Input 2
abc
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.