#C14395. Find the Most Frequent Alphabetical Character
Find the Most Frequent Alphabetical Character
Find the Most Frequent Alphabetical Character
Given a string, your task is to find the alphabetical character (ignoring case) that appears most frequently. Only letters (a-z, A-Z) should be considered, and any non-alphabetical characters must be ignored. In the case where multiple letters share the highest frequency, choose the one that comes first in the alphabet (i.e., the smallest letter). If the input string is empty or contains no alphabetical characters, output an empty string.
Note: If there are ties, the letter that is lexicographically smallest is chosen.
Example:
- Input: "Hello World!"
- Output: "l"
inputFormat
The input consists of a single line containing a string.
outputFormat
Output a single line containing the most frequent alphabetical character as specified. If no alphabetical character exists, output an empty string.
## sampleHello World!
l