Problem 121 · Easy

Best Time to Buy and Sell Stock

Single pass: track the running minimum price and compute the best profit at each step.

Open the interactive visualisation