class Solution: def majorityElement(self, nums: List[int]) -> int: return max(Counter(nums).items(), key=lambda k: k[1])[0]