Find the element that appears more than n/2 times in a list.
Constraints
Example
>>> majority_element([3, 2, 3]) 3 >>> majority_element([2, 2, 1, 1, 1, 2, 2]) 2 >>> majority_element([1]) 1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints