You are given two present and future of length n, where present[i] is the current price of the future[i] is the anticipated future price of the budget.
You may buy each stock at most once, and the total cost to buy the chosen stocks cannot exceed budget.
Return the maximum profit that can be achieved.
Constraints:
n present.length future.length
n
present[i], future[i]
budget
You are given two present and future of length n, where present[i] is the current price of the future[i] is the anticipated future price of the budget.
You may buy each stock at most once, and the total cost to buy the chosen stocks cannot exceed budget.
Return the maximum profit that can be achieved.
Constraints:
n present.length future.length
n
present[i], future[i]
budget