Loading...
Loading...
Loading...
A spell-check tool wants the most common letter of a word. If two letters tie, choose the one that comes first in the alphabet. Print the letter and its count.
Example
Input
mississippi
Output
i 4
i and s both appear 4 times; i comes first.
Try the problem first. Open one hint at a time.
Count each letter once with a dictionary or Counter.
Pick the letter with the highest count; break ties with the smaller letter.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor