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