Back to Question

Count of Smaller Numbers After Self

Question Explain

Given an integer array `nums`, return an array `counts` where `counts[i]` is the number of elements to the right of `nums[i]` that are strictly smaller than `nums[i]`. Use a modified Merge Sort or Fenwick Tree/Segment Tree.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.