class Solution: def majorityElement(self, nums: List[int]) -> int: f = int(len(nums)/2) for n in set(nums): if nums.count(n) > f: return n