FunctionRacerProblemsRace

Most Frequent Word

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

text has words separated by single spaces. Return the word that appears most often. If several words tie, return the one that comes first in alphabetical order.

Example 1

text "to be or not to be"
returns "be"

to and be appear twice; be comes first alphabetically.

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