Given an array arr containing non-negative integers. Count and return an array res where res[i] denotes the number of smaller elements on right side of arr[i].
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(n log n)
Expected Auxiliary Space: O(n)
Constraints:
1 = arr.size() = 10^6
0 = arr[i] = 10^8
Companies:
Google
Topics:
Array
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.