AlgoMaster Logo

Best Time to Buy and Sell Stock with Cooldown

prices=[1, 2, 3, 0, 2]
0 / 18
pricesheldholding a stocksoldjust sold todayrestidle / cooldowntrack 3 states per day, you can only buy from rest, and selling forces a cooldown
algomaster.io
Step:Start: stock prices = [1, 2, 3, 0, 2], one buy/sell at a time with a 1-day cooldown after selling