Stock trading with cooldown
Your task
Given daily prices of a stock, you may complete as many buy/sell transactions as you like, but you can hold at most one share at a time and after you sell you must wait one full day (cooldown) before buying again. Return the maximum profit. The price list may be empty.
Examples
stock_with_cooldown(prices: list[int]) -> intExample 1
Input
stock_with_cooldown([1, 2, 3, 0, 2])Output
3