I was looking at the solution to Disk stacking problem.
Could somene explain why do we need to sort the disks first? In the solution the array is sorted on basis of height at the start.
I could post the solution if necessary.