Majority Element

EasyArrays
Next
ArrayHashing

The majority element appears more than n / 2 times. You are guaranteed that the array has one. Find it.

Input

Line 1: n. Line 2: n integers.

Output

Print the majority element.

Constraints

1 <= n <= 5 * 10^4 -10^9 <= each value <= 10^9

Example 1
Input
7
2 2 1 1 1 2 2
Output
2

2 appears 4 times out of 7.

Hints

Majority Element - Easy Arrays Problem | Skill Shiksha