3 added 614 characters in body
source | link

JavaScript ES6, 87 82 79 7474 70 bytes

(a,b={})=>a.map((l,i)=>[l=>[...a].sort((a,b)=>a-b).indexOf(l)+(b[l]=b[l]+1|0))

Don't like using an object but it seems to be the shortest way to keep track of dupes

Explanation

(a,b={})=>          `a` is input
                    `b` stores the occurrences of each number
  a.map(l =>        Loop over the array, `l` is item
  [...a]            Copy `a`
    .sort(...)       Sort in ascending numerical order
    .indexOf(l)      Index of input in that array
  +                 Add the following to account for dupes
   (b[l]=            set and return the item `l` in hashmap `b` to...
     b[l]+1           Increase the counter by one if it exists yet
     |0               default is zero
   )

JavaScript ES6, 87 82 79 74 bytes

(a,b={})=>a.map((l,i)=>[...a].sort((a,b)=>a-b).indexOf(l)+(b[l]=b[l]+1|0))

Don't like using an object but it seems to be the shortest way to keep track of dupes

JavaScript ES6, 87 82 79 74 70 bytes

(a,b={})=>a.map(l=>[...a].sort((a,b)=>a-b).indexOf(l)+(b[l]=b[l]+1|0))

Don't like using an object but it seems to be the shortest way to keep track of dupes

Explanation

(a,b={})=>          `a` is input
                    `b` stores the occurrences of each number
  a.map(l =>        Loop over the array, `l` is item
  [...a]            Copy `a`
    .sort(...)       Sort in ascending numerical order
    .indexOf(l)      Index of input in that array
  +                 Add the following to account for dupes
   (b[l]=            set and return the item `l` in hashmap `b` to...
     b[l]+1           Increase the counter by one if it exists yet
     |0               default is zero
   )
2 added 7 characters in body
source | link

JavaScript ES6, 87 8282 79 74 bytes

(a,b={})=>a.map((l,i)=>(b[l]=b[l]+1||1,[=>[...a].sort((a,b)=>a-b).indexOf(l)+b[l]-1+(b[l]=b[l]+1|0))

Don't like using an object but will tryit seems to find a betterbe the shortest way to keep track of dupes.

JavaScript ES6, 87 82 bytes

(a,b={})=>a.map((l,i)=>(b[l]=b[l]+1||1,[...a].sort((a,b)=>a-b).indexOf(l)+b[l]-1))

Don't like using an object but will try to find a better way to keep track of dupes.

JavaScript ES6, 87 82 79 74 bytes

(a,b={})=>a.map((l,i)=>[...a].sort((a,b)=>a-b).indexOf(l)+(b[l]=b[l]+1|0))

Don't like using an object but it seems to be the shortest way to keep track of dupes

1
source | link

JavaScript ES6, 87 82 bytes

(a,b={})=>a.map((l,i)=>(b[l]=b[l]+1||1,[...a].sort((a,b)=>a-b).indexOf(l)+b[l]-1))

Don't like using an object but will try to find a better way to keep track of dupes.