Problem 122 · Medium

Best Time to Buy and Sell Stock II

Maximize profit with unlimited transactions by capturing every upward price movement.

Open the interactive visualisation