parameters: (self, nums)
return_statement: return nums[idx]
docstring: :type nums: List[int]
          :rtype: int
docstring_summary: :type nums: List[int]
          :rtype: int
docstring_tokens: : type nums : List [ int ] : rtype : int
function: def majorityElement(self, nums):
          """
          :type nums: List[int]
          :rtype: int
          """
          idx, cnt = 0, 1
  
          for i in xrange(1, len(nums)):
              if nums[idx] == nums[i]:
                  cnt += 1
              else:
                  cnt -= 1
                  if cnt == 0:
                      idx = i
                      cnt = 1
  
          return nums[idx]
function_tokens: def majorityElement ( self , nums ) : idx , cnt = 0 , 1 for i in xrange ( 1 , len ( nums ) ) : if nums [ idx ] == nums [ i ] : cnt += 1 else : cnt -= 1 if cnt == 0 : idx = i cnt = 1 return nums [ idx ]