HBOS Interview Question

sorting array and time complexity