Leetcode 315. Count of Smaller Numbers After Self
For each element in an integer array, return how many elements to its right are smaller than it. With n up to 1e5 this requires an O(n log n) approach (e.g., Fenwick tree / balanced BST with subtree counts or merge-sort counting) rather than brute force.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.