Easy python solution 5 line code


#1

class Solution:
# @param A : tuple of integers
# @return an integer
def majorityElement(self, A):
A=sorted(A)
n=len(A)
for i in range(n):
if A[i]==A[i+int(n/2)]:
return A[i]