Pregunta de entrevista de Upwind

Array sorting question which I do not remember