Myant interview question

Data structure problem solving (sorting array)