HBOS interview question

sorting array and time complexity