Count of Smaller Numbers After Self

Hard

📝 Description

Count how many elements to the right are smaller than current element

Input Format

Space-separated array elements

Output Format

Counts for each element

Constraints

1 ≤ nums.length ≤ 10^5

🔍 Sample Input

5 2 6 1
            

✅ Sample Output

2 1 1 0
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run