Array in Order
im trying to make a method that takes in an array and makes a new array with the values from 0 to the array.length-1 so that the array it returns will corrispond with the values in the original array (if the number at the original element[ n ] is the higest number of all the array its value in the new array would be array.length-1
examples:
{81,-81,10,2,-2,-10} becomes {5,0,4,3,2,1}
{79,-17,2,0,0,-2}becomes {5,0,4,2,3,1}
{80,-80,0,0,0,0} becomes {5,0,1,2,3,4}
i tried something like this:
int[] newOrder =newint[order.length];
for(int i = 0; i < newOrder.length; i++)
newOrder[i]=0;
for(int h = 0; h < order.length;h++)
for(int g = 0; g < order.length;g++)
if(order[h]>order[g])
newOrder[h]++;
cept with that if i send it {80,-80,0,0,0,0} it comes out {5,0,1,1,1,1} which is not what i want, i want each number to be a differnt number between 0 and array.length-1

