LTM Limited interview question

Print array in sorted order