229. Snake Game — Find the Longest Run
Easy · String
In a simplified Snake game, the snake leaves a trail of identical characters in a string. Find the length of the longest consecutive run of the same character.
Examples
Example 1 Input: "aaabbbbbcc" Output: 5 Explanation: 'bbbbb' is the longest run (length 5)
Constraints
- 1 ≤ trail.length ≤ 100