values. For each element values[i], count how many elements of the array are strictly smaller than it.
Return an array of the same length whose position i holds the count for values[i].values=[4, 9, 4, 0] → [1, 3, 1, 0]
Only 0 is below 4; three values (4, 4 and 0) are below 9; nothing is below 0. Equal values do not count.
values=[10, 20, 30] → [0, 1, 2]
The array is already sorted, so each answer equals the index.
values=[2, 2] → [0, 0]
len(values) ≤ 10⁵values[i] ≤ 100values=[4, 9, 4, 0]
[1, 3, 1, 0]
Run checks the first 3 tests in your browser. Submit checks all 111 tests on the server, hidden ones included.