Goldman Sachs 2025-October | OA | Modified Merge Sort & Greedy Heaps
Goldman-Sachs · Question · Posted Jun 2026
Question 1: Count of Smaller Numbers After Self Problem Statement Given an integer array nums, return an integer array counts where counts[i] is the total number of strictly smaller elements positioned to the right of nums[i] in the array. Constraints 1 <= nums.length <= 105 -104 <= nums[i] <= 104 Example Input: nums = [5,2,6,1] Output: [2,1,1,0] Explanation To the right of 5 there are 2 smaller elements (2 and 1). To the right of 2 there is only 1 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account