CT831

Harper's Ledger of labels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Morning light hits the ivory gates of Alabast as Harper unrolls the day's manifest of labels. The tally will decide the next shipment. 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| <= 148; s contains lowercase English letters.

Example 1:

Input: bbbbbbbcccbbbbbbbbbbbbbbbcaabbbaaaaaaabbbbbbb
Output: 15

Example 2:

Input: aaaaaaaccccccaaaccccabbbbaaaaaaaaaaaaabbccccccccbbbbbaaaaabb
Output: 13

Example 3:

Input: bbbbaaaabbbbbbabccccccaaaaaaacccccacccccbaaabbbbbbbbaccccc
Output: 8

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Harper's Ledger of labels - EASY Coding Problem | CodeTikki