#K87957. Most Frequent Character in a String
Most Frequent Character in a String
Most Frequent Character in a String
Given a string s
, your task is to determine the character that appears the most frequently. In the case where multiple characters have the same highest frequency, you must output the first such character in the order of appearance in s
.
You are required to read the input from standard input (stdin) and print the result to standard output (stdout).
Note: The solution should consider all characters including letters, digits, punctuation, and spaces.
inputFormat
The input consists of a single line containing the string s
.
Constraints: The string may contain any printable characters.
outputFormat
Output a single character: the one that occurs most frequently in the string. If there are multiple such characters, output the first one that appears in the string.
## samplea
a