Search across blog, articles, projects, courses, and community posts
Find the word that appears most often. If several words tie, choose the one that comes first alphabetically.
Input:
n, the number of words.n lowercase words separated by spaces.Output: word count, separated by a space.
1 <= n <= 1000. Each word has 1 to 10 lowercase letters.
6 the cat the dog the cat
the 3
4 b a b a
a 2