I\'m trying to sort an array [3,3,2,1,3,2,2,2,1] to [1,1,3,3,3,2,2,2,2].
[3,3,2,1,3,2,2,2,1]
[1,1,3,3,3,2,2,2,2]
I\'m trying to handle it using object, using the number as key, and th
Try something like
var curIndex = 0; for i in result { arr.fill(i, curIndex, curIndex + result[i]); curIndex = curIndex + result[i]; }