parameters: (self, nums)
return_statement: return min(right[num]-left[num]+1 \
                     for num in counts.keys() \
                     if counts[num] == degree)
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 findShortestSubArray(self, nums):
          """
          :type nums: List[int]
          :rtype: int
          """
          counts = collections.Counter(nums)
          left, right = {}, {}
          for i, num in enumerate(nums):
              left.setdefault(num, i)
              right[num] = i
          degree = max(counts.values())
          return min(right[num]-left[num]+1 \
                     for num in counts.keys() \
                     if counts[num] == degree)
function_tokens: def findShortestSubArray ( self , nums ) : counts = collections . Counter ( nums ) left , right = { } , { } for i , num in enumerate ( nums ) : left . setdefault ( num , i ) right [ num ] = i degree = max ( counts . values ( ) ) return min ( right [ num ] - left [ num ] + 1 for num in counts . keys ( ) if counts [ num ] == degree )