Computer Science, asked by sara3090, 10 months ago

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].

Answers

Answered by kanika575
0

Answer:

To the right of 6 there is 1 smaller element (1). To the right of 1 there is 0 smaller element. The trivial solution is pretty obvious. For every number in our nums array, we just iterate through the rest of the array and count all of the numbers that are less than that specific number.

Similar questions