Pancake Sorting question