FunctionRacerProblemsRace

Most Common Letter

EasyHash mapsPython, JavaScript, TypeScript, Java, C++

Return the lowercase letter that appears most often in s. Ignore every character that is not a letter, and treat upper and lower case as the same letter. If several letters tie, return the one that comes first in the alphabet. The input has at least one letter.

Example 1

s "Hello, World!"
returns "l"

l appears 3 times.

Example 2

s "ab AB"
returns "a"

Tie of 2 each; a is first.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Hash maps problems