An algorithm to solve the pancake flip problem.