Problems > Longest Run of One Letter > Editorial

Longest Run of One Letter — Solution & Editorial

Back to the Problem

Track the current run length, resetting when the character changes.

Complexity: O(|S|)