Frequency
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Problem Statement
You are given a string S
consisting of lowercase English letters. Find the character that appears most frequently in S
. If multiple such characters exist, report the one that comes earliest in alphabetical order.
Constraints
- 1≤∣
S
∣≤1000 (∣S
∣ is the length of the stringS
.) - Each character in S is a lowercase English letter.
Input
The input is given from Standard Input in the following format:
S
Output
Among the characters that appear most frequently in S, print the one that comes earliest in alphabetical order.
Sample Input 1
frequency
Sample Output 1**
e
In frequency
, the letter e
appears twice, which is more than any other character, so you should print e
.
Sample Input 2
pseudopseudohypoparathyroidism
Sample Output 2
o
Limitation
1s, 1024KiB for each test case.