Problems
Majority Element
Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times.
Input data
The first line contains number n~(1 \le n \le 100). The second line contains n positive integers.
Output data
If the array contains majority element, then print it. Otherwise print -1.
Examples
Input example #1
7 3 3 5 4 2 3 3
Output example #1
3
Input example #2
4 2 3 2 3
Output example #2
-1