What is the best algorithm/approach to iterate through a file with numerous lines of Countries and printing out the country with the most occurrences?
Each line is a string and only contains a country name on each line.
Assume there could be 1 billion distinct countries. (Countries is a bad example)
United States
Iran
India
United States
China
Iran
....
....
Canada //1 billionth line
1 Answer