Python one-liner


  • -2
    C
    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]

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.