DC Energy interview question

Sorting boxes algorithm and case study