Longest Run of Identical Characters

Given a non-empty string s, return the length of the longest contiguous substring consisting of the same character.

A substring must occupy consecutive positions in the original string.

**Exam...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: