Pergunta de entrevista da empresa Microsoft

Sorting an array that is already k-sorted