parameters: (self, A)
return_statement: return res
docstring: :type A: List[int]
          :rtype: List[int]
docstring_summary: :type A: List[int]
          :rtype: List[int]
docstring_tokens: : type A : List [ int ] : rtype : List [ int ]
function: def pancakeSort(self, A):
          """
          :type A: List[int]
          :rtype: List[int]
          """
          res = list()
          for i in range(len(A), 1, -1):
              idx = A.index(i)
              A = A[:idx:-1] + A[:idx]
              res += [idx + 1, i]
              
          return res
function_tokens: def pancakeSort ( self , A ) : res = list ( ) for i in range ( len ( A ) , 1 , - 1 ) : idx = A . index ( i ) A = A [ : idx : - 1 ] + A [ : idx ] res += [ idx + 1 , i ] return res