#C11525. Most Frequent Character
Most Frequent Character
Most Frequent Character
Given a string (s) provided via standard input, identify the character that occurs most frequently. In case multiple characters share the highest frequency, return the one that appears first in (s). This problem requires reading from STDIN and writing the result to STDOUT. For example, if the input is aabbbcc
, the output should be b
.
inputFormat
A single line containing the string (s). The string may be empty.
outputFormat
A single character which is the most frequent in (s). If (s) is empty, output an empty string.## sample
aabbbcc
b