#C105. Most Popular Programming Language
Most Popular Programming Language
Most Popular Programming Language
Given an integer \(n\) and a list of \(n\) programming languages, determine which programming language is the most popular. In case of a tie, choose the lexicographically smallest language. You must read the input from stdin
and print the result to stdout
.
The key idea is to compute the frequency of each language and then select the language with the highest frequency. If multiple languages have the same maximum frequency, the answer is the one with the smallest lexicographical order.
inputFormat
The first line contains an integer \(n\), the number of programming languages. The second line contains \(n\) space-separated strings, each representing a programming language.
outputFormat
Output a single string—the most popular programming language. If there is a tie, output the lexicographically smallest one.
## sample1
Python
Python