229. Majority Element II

class Solution(object):
    def majorityElement(self, nums):
        """
        :type nums: List[int]
        :rtype: List[int]
        """
        return [i for i in set(nums) if nums.count(i)>len(nums)/3]

你可能感兴趣的:(229. Majority Element II)