Bloomberg interview question

Technical question K messed sort array