Element repeated more than n/2 times – Fast majority vote algorithm

Find the element which repeated more than n/2 times in an given array of integers.

For example, A=[2, 2, 3, 2, 3, 3, 1, 3, 1]. We can clearly see that 3 is the majority.