preferably without using externals, can anyone tell me how to do this:
*********************
input: 0, 3, 5, 10
output: 1, 2, 3, 4
*********************
input: 10, 5, 3, 0
output: 4, 3, 2, 1
*********************
input: 10, 3, 0, 5
output: 4, 2, 1, 3
*********************