Ericsson interview question

sorting the given array with less time complexity