Pregunta de entrevista de Microsoft

The question is to sort array