Pregunta de entrevista de RBC

A simple coding question having to do with sorting arrays