← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Problem Statement
You are given an integer array nums. Return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].[1][2]
Example 1
Input: nums =[2][5][6][1]
Output:[1][2]
Explanation:
Example 2
Input: nums = [-1]
Output:
Explanation: No elements to the right.[9]
Example 3
Input: nums = [-1,-1]
Output:
Explanation: The element to the right is equal, so not smaller.[9]
Constraints