Pregunta de entrevista de Altisource

Sorting a array of int with out using second loop.