Best time to buy and sell stock, every variant
Given daily stock prices, solve the variants of the maximum-profit problem (for example a single trade, many trades, or at most k trades) with one unified approach.
No answer yet. Write the first one; the best answer gets endorsed.
