class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
unique_nums = list(set(nums))
count = len(nums)
max_count = nums.count(unique_nums[0])
result = unique_nums[0]
for num in unique_nums:
if max_count < nums.count(num):
result = num
max_count = nums.count(num)
return result