An array has number of elements. All elements are integers and unique, which means there is no repetitive integers.
(e.g.) $foo = array(7, 5, 9, 13, 2, 8);
You have to sort the array, provided:
- You should scan the elements only once.
- You're not allowed to compare the elements when sorting. (i.e., you're not supposed to use any comparison operators)
- Sorted resultant array may not be the source array.