def pancake_sort(nums):
    
    arr_len = len(nums)
    while arr_len > 1:
        mi = nums.index(max(nums[0:arr_len]))
        nums = nums[mi::-1] + nums[mi+1:len(nums)]
        nums = nums[arr_len-1::-1] + nums[arr_len:len(nums)]
        arr_len -= 1
    return nums
def pancake_sort(VAR_0):
    arr_len = len(VAR_0)
    while arr_len > 1:
        mi = VAR_0.index(max(VAR_0[0:arr_len]))
       
        VAR_0 = VAR_0[mi::-1] + VAR_0[mi + 1 : len(VAR_0)]
        VAR_0 = VAR_0[arr_len - 1 :: -1] + VAR_0[arr_len : len(VAR_0)]
        arr_len -= 1
    return VAR_0