Array
1331. Rank Transform of an Array
Replace each element with its rank — its position among the sorted distinct values, starting at 1, equal values sharing a rank, no gaps. So [40,10,20,30] → [4,1,2,3], and with duplicates…
Loading…
Replace each element with its rank — its position among the sorted distinct values, starting at 1, equal values sharing a rank, no gaps. So [40,10,20,30] → [4,1,2,3], and with duplicates…
Loading…