Problem Submissions Solution

Count Smaller elements

Difficulty: Hard

Acceptance: %

Points: 40.00

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
Locked Content
Access Restricted: Please Login to access the code editor and test cases.