CT2297

Last letters of Xavi

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Every season at the lotus ponds of Tranquil Basin, someone must secure the caravan contract. This year the task falls to Xavi, armed only with the letters register. 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| <= 111; s contains lowercase English letters.

Example 1:

Input: ccaaccccaaaacccccbbbccccccccccccbbbbbbbaccaaacbb
Output: 12

Example 2:

Input: ccccccccccccccbbbbbbbbbbbbbbbbbbaabbaaaabbbbbbcbbbbbbaaaabaa
Output: 18

Example 3:

Input: bbbbbcccccbbabbbbaaaabbbbaaaaaaaaaacccccccccbbc
Output: 10

Constraints:

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

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