Given an array of size n, find the element that appears more than n/2 times.

Example

nums = [2,2,1,1,1,2,2]

Output: 2

Enter fullscreen mode