Word Count

BRACU Intra Programming C...
Limits 1s, 512 MB

Counting the frequencies of words are a basic and important task in natural language processing. In this problem, you will be given a text, and you have to print the word that has occurred the most number of times in that text.


The input contain at most 100 lines. Each of these lines will have at most 100 words each. Each word will consist of only alphabets. Each word will have at most 20 characters each. A line will only have words and spaces.


For each dataset, output the word that has appeared the most number of times in the dataset. It is guaranteed that only one word will have the most number of occurrences in a dataset.


big league
little league
big and little league

You will have to read the input until the end of file (EOF).


Login to submit.


93% Solution Ratio
subintra2016.12$7Z9DgEarliest, Nov '16
whoisdidarFastest, 0.0s
inkuet2016.21$0UsWiLightest, 131 kB
ShuddhoShortest, 86B
Toph uses cookies. By continuing you agree to our Cookie Policy.