#C3173. Longest Uniform Substring
Longest Uniform Substring
Longest Uniform Substring
Given a string, find the longest contiguous substring in which all characters are identical. If there are multiple substrings with the same maximum length, output the one that appears first in the string. For an empty string, output an empty string.
The problem tests your ability to process strings and maintain running counts. The solution should use straightforward iteration.
For example, if the input is aaabbccddddde
, then the answer is ddddd
.
inputFormat
The input consists of a single line containing a string s. The string can be empty and may contain any characters.
outputFormat
Output the longest contiguous substring from the input in which all the characters are the same. If the input string is empty, output an empty string.
## sampleaaaa
aaaa