Pergunta de entrevista da empresa Baykar Technologies

Simple sorting problem with code test