Majority Element

Find the element that appears more than half the time in an array. The Boyer-Moore voting algorithm cancels pairs of different elements, leaving the majority as the survivor.

Examples
Input: [3,2,3]
Output: 3
Hints

Majority Element

Find the element that appears more than half the time in an array. The Boyer-Moore voting algorithm cancels pairs of different elements, leaving the majority as the survivor.