Mojoreads interview question

Q. Basic coding question on array and sorting.