Madam C.J. Walker's Business Plan
Madam C.J. Walker, known as the first African-American businesswoman in America, had a business model involving the sale of cosmetics and perfumes for women, which can be likened to a modified 0-1 knapsack problem.
There are n different products available for purchase and resale. The cost of the i item is given by cost[i], and it can be resold for a profit of 2 ** i.
Given the total available to x to invest, determine the maximum profit that can be generated with the given amount of money. Since the answer can be quite large, return the result modulo (10 ** 9 + 7).
Complete the function calculateMaximumProfit in the editor.
calculateMaximumProfit has the following parameters:
cost: List[int]: an array of integers representing the cost of each itemx: int: the total amount available to invest
Returns
int: the maximum profit that can be generated modulo (10 ** 9 + 7)
All credit goes to an incredible friend who made it all possible! 🧡