1 line Python Solution


  • 0
    B
    class Solution(object):
    def majorityElement(self, nums):
        return sorted([[nums.count(x),x] for x in set(nums)],reverse=True)[0][1]

Log in to reply
 

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