Word problems › Money and shopping › Best buy within a budget

Two stock transactions on three days

High school · ●○○○○ 10 pts

The price of a stock on days 1, 2 and 3 is $2, $4 and $1. You may complete at most 2 transactions (a transaction is one buy followed by one sell), and you must sell the stock before you buy again. Find the maximum profit in dollars.

Sign in to save your progress.

dynamic programming