Pergunta de entrevista da empresa LiveRamp

Sub sort an array in nlogn time, given the rest of the array is sorted.