code: def summarize_ranges(array):
      
      res = []
      if len(array) == 1:
          return [str(array[0])]
      i = 0
      while i < len(array):
          num = array[i]
          while i + 1 < len(array) and array[i + 1] - array[i] == 1:
              i += 1
          if array[i] != num:
              res.append((num, array[i]))
          else:
              res.append((num, num))
          i += 1
      return res
docs: :type array: List[int]
      :rtype: List[]