Given an array of integers, for each element, count how many elements in the array are strictly smaller than it. Return an array of these counts.
Input: [8,1,2,2,3]
Output: [4,0,1,1,3]
Explanation: For 8, four numbers (1,2,2,3) are smaller; for 1, no number is smaller; for each 2, one number (1) is smaller; for 3, three numbers (1,2,2) are smaller.
Input: [6,5,4,3,2,1]
Output: [5,4,3,2,1,0]
Input: [1,2,3]
Output: [0,1,2]
Your notes are automatically saved in your browser's local storage and will persist across sessions on this device.