I have an array. It looks like below:
var num = [2,1,2,6,2,4];
I would like to sort but return index to an array:
var result = [1, 0, 2, 4, 5, 3];
If there is a same number, the smaller index of should be placed first.
I have an array. It looks like below:
var num = [2,1,2,6,2,4];
I would like to sort but return index to an array:
var result = [1, 0, 2, 4, 5, 3];
If there is a same number, the smaller index of should be placed first.