Problem 3573 · Medium

Best Time to Buy and Sell Stock V

A day-by-day DP tracks the open transaction, either a buy or a short sale, and the number of transactions opened so far.

Open the interactive visualisation