Majority Banner (Arrays & Lists)

In a list of n votes, one value appears more than n / 2 times. Print that value.

Input: n (1 to 1000), then n integers between -10^9 and 10^9.

Output: The majority value.

Difficulty: Easy. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • Count every value with a map.

More Arrays & Lists practice