Return the element that occured more than (n/2) times
	## its coming as TLE for my submission
	
       for i in range(len(nums)):
            swap=False
            for j in range(1,len(nums)-i):
                if nums[j-1] > nums[j]:
                    swap=True
                    nums[j-1],nums[j] = nums[j],nums[j-1]
            if not swap:
                break

       return nums[len(nums)//2]
Comments (2)