'''
Given an an unsorted array, sort the given array. You are allowed to do only following operation on array.

flip(arr, i): Reverse array from 0 to i 
Unlike a traditional sorting algorithm, which attempts to sort with the fewest comparisons possible, the goal is to sort the sequence in as few reversals as possible.

Example
Given array = [6, 7, 10, 11, 12, 20, 23]
Use flip(arr, i) function to sort the array.
'''
"""
class FlipTool:

    @classmethod
    def flip(cls, arr, i):
        ...
"""
class Solution:
    """
    @param array: an integer array
    @return: nothing
    """
    def pancakeSort(self, array):
        # Write your code here