Rently interview question

Sorting array with reducing the size