CT1795

Last labels of Xavi

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Legend says the vault under the shale slopes of Greystone opens only for a perfect tally of labels. Xavi means to find out. 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| <= 176; s contains lowercase English letters.

Example 1:

Input: bbbccccccccaaaabbbbbbbccaaaacccccbbbbbcccbaaaaabbbbbbbaa
Output: 8

Example 2:

Input: bbbbcccccbbbbacccbccccaaaaabbbccccccaa
Output: 6

Example 3:

Input: cccaaabbccccaaabbbbbccccaaaabbbbbbbbccccbbbaa
Output: 8

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last labels of Xavi - EASY Coding Problem | CodeTikki