Mojoreads Interview Question

Q. Basic coding question on array and sorting.