FunctionRacerProblemsRace

Consecutive Characters

BeginnerStringsPython, JavaScript, TypeScript, Java, C++

Return the length of the longest run of one repeated character in s. A single character is a run of length 1.

Example 1

s "abbcccddddeeeeedcba"
returns 5

The longest run is eeeee.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems