WEX interview question

Write code to sort packages based on their dimensions and weight