Luxoft interview question

To solve a sorting problem