#C10241. Longest Uniform Substring
Longest Uniform Substring
Longest Uniform Substring
Given a string \( s \), find the length of the longest contiguous substring that contains only one unique character. In other words, determine the maximum length \( L \) such that there exists a substring of \( s \) where every character is identical. For instance, in the string aabbccccddd
, the longest uniform substring is cccc
with a length of 4. If the input string is empty, the result is 0.
Note: The string \( s \) may include letters, digits, and special characters.
inputFormat
The input consists of a single line containing the string \( s \).
outputFormat
Print a single integer denoting the length of the longest contiguous substring in \( s \) that consists of a single repeated character.
## sampleaabbccccddd
4