Count Of Smaller Numbers After Self

hard
You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].

Input Format

Input is managed for you

Output Format

Output is managed for you

Constraints

1 <= nums.length <= 10^5
-10^4 <= nums[i] <= 10^4

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
4
5 2 6 1
Output
2 1 1 0
Previous
Path Sum In Binary Tree - Ii
Next
Redundant Connection

Related Questions