Solve 169. Majority Element
This commit is contained in:
parent
120ab5f7a0
commit
eaa8414c67
3
python/169_majority_element.py
Normal file
3
python/169_majority_element.py
Normal file
@ -0,0 +1,3 @@
|
||||
class Solution:
|
||||
def majorityElement(self, nums: List[int]) -> int:
|
||||
return max(Counter(nums).items(), key=lambda k: k[1])[0]
|
Loading…
Reference in New Issue
Block a user