```
class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
length = len(nums)
sorted_nums = sorted(set(nums))
for i in sorted_nums:
if nums.count(i) >= length/2 + 1:
return i
```