Consecutive Characters

Find the maximum length of a substring containing the same character. Scan the string once, tracking the current run length and updating the maximum seen so far.

Examples
Input: "leetcode"
Output: 2
Hints

Consecutive Characters

Find the maximum length of a substring containing the same character. Scan the string once, tracking the current run length and updating the maximum seen so far.