LeetCode
Pancake Sorting
Click
here
for an explanation.