Pergunta de entrevista da empresa Anonymous

Sort half array in ascending and other half in descending order