120 - Stacks of Flapjacks

A solution to this problem is quite straightforward: You keep “flipping” the largest unsorted pancake until all pancakes are sorted.

Creative Commons License
This blog by Che-Liang Chiou is licensed under a Creative Commons Attribution 4.0 International License.