반응형
leetcode.com/problems/majority-element/
한줄풀이!!
class Solution:
def majorityElement(self, nums: List[int]) -> int:
return collections.Counter(nums).most_common(1)[0][0]
leetcode.com/problems/majority-element/
한줄풀이!!
class Solution:
def majorityElement(self, nums: List[int]) -> int:
return collections.Counter(nums).most_common(1)[0][0]
댓글