Company: Point72_16nov
Difficulty: medium
Android In-App Upgrades Problem Description In an Android app, there are n in-app upgrades listed. The cost of the i-th upgrade is given by upgradeCosts[i], and it enhances the app's functionality by a factor of 2^i. You are given a limited amount of currency represented by an integer, budget. Implement a function that selects a combination of upgrades such that the total enhancement is maximized without exceeding the available budget. The function optimizeInAppUpgrades takes the following inputs: vector upgradeCosts: the costs of each in-app upgrade int budget: the in-app currency available to spend The function should return the maximum enhancement that can be obtained, modulo (10^9 + 7). int optimizeInAppUpgrades(vector upgradeCosts, int budget) { // Function implementation } Examples Example 1: Input: n = 5, upgradeCosts = [10, 20, 30, 40, 50], budget = 70 Output: 20 Explanation: Some valid upgrade combinations are: Select upgrades 0, 1 and 2: total cost = 10 + 20 + 30 = 60. Enhanc