CT2144

Wade's Ledger of labels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the garden city of Petalbrook, Wade records each labels in a worn leather ledger. The guild wants answers, not guesses. 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| <= 132; s contains lowercase English letters.

Example 1:

Input: bbbcccccabbaaaacccaaabbbccc
Output: 5

Example 2:

Input: aaaaabaacbbbbcccccccccccccccb
Output: 15

Example 3:

Input: cccbbbbbaaaaabbbbbcccaaaca
Output: 5

Constraints:

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

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