CT1706

The Mossy Longest Streak

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the gull cliffs of Screech Point pays by the answer, and Potter intends to earn it. First: the full register of banners. Task: Print the length of the longest run of the same character. Input format: One line with a single lowercase string s. Output format: Print the maximum run length. Constraints: 1 <= |s| <= 147; s contains lowercase English letters.

Example 1:

Input: ccbbbbcccbaaabbbbbcccccaacccabaacbbbbbaaaaaaabbcccbbbbaaaacccbbbbbaa
Output: 7

Example 2:

Input: cccccbbbcccbbbbbbbaaaaaaaccccaabbbbbaaaabbbbbaaaabbbba
Output: 7

Example 3:

Input: aacccccaaaaabbbbccaabbbbccccaabbbbbbbaaaaaccaaaacccaaaaaaaaaaaacbbaaaaabbabbbbbbbaa
Output: 12

Constraints:

1 <= |s| <= 147; s contains lowercase English letters.

Loading...
Test Cases:No test cases
No test cases available.
The Mossy Longest Streak - EASY Coding Problem | CodeTikki