Company: Amazon_17sep
Difficulty: medium
Minimum Removals to Stay within Budget Problem Description Amazon developers are building a prototype feature that helps customers manage their cart within a given budget. You are given: An integer budget , representing the budget of the customer. An integer array cart_items of length n , where cart_items[j] represents the price of the j th item. For each index i ( 0 ≤ i < n ), consider the sub-cart containing items from index 0 to i (inclusive), i.e., sub-cart = cart_items[0...i] . For this sub-cart, determine the minimum number of items required to remove so that the total price of cart items does not exceed the budget . Note: The item at index i cannot be removed. The task is to return an array of length n , where the value at index i is the minimum number of items to remove for the sub-cart ending at i . Function Description: Complete the function getMinRemovals in the editor below. The function is expected to return an INTEGER_ARRAY . The function accepts the following param