Sort an array of integers into ascending order using Pancake sorting.
Instead of individual elements being sorted, the only operation allowed is to "flip" one end of the list. E.g. array [3,2,4,1,0] after the flip up to the element with value 4 becomes [4,2,3,1,0].
Problem at Leetcode.