#B4262. Most Frequent Word
Most Frequent Word
Most Frequent Word
In text processing, counting the frequency of words is a common task. Given (n) words, your task is to find the word that appears most frequently.
Note that the case of letters should be ignored; for instance, Apple
, apple
, APPLE
, and aPPle
are all considered the same word.
inputFormat
The first line of input contains an integer (n), representing the number of words. Each of the next (n) lines contains one word. All comparisons should be made in a case-insensitive manner.
outputFormat
Output the word (in lowercase) that occurs most frequently. It is guaranteed that there is a unique answer.
sample
5
Apple
banana
apple
grapes
orange
apple
</p>