class Solution:

    def majorityElement(self, nums):
        nums = sorted(nums)
        i = 0
        for _ in range(len(set(nums))):
            if nums.count(nums[i]) >= len(nums) / 2:
                return nums[i]
            else:
                i = i + nums.count(nums[i])

b44b109707021f1bcbbc2370b1501ae06f546654
<mask token>

class Solution:
    <mask token>

class Solution:

    def majorityElement(self, nums):
        nums = sorted(nums)
        i = 0
        for _ in range(len(set(nums))):
            if nums.count(nums[i]) >= len(nums) / 2:
                return nums[i]
            else:
                i = i + nums.count(nums[i])
