Pergunta de entrevista da empresa Amazon

sort an array by decreasing the time complexity