Pregunta de entrevista de Toptal

Sort the array with its special order