Given daily stock prices, you may complete unlimited transactions, but after selling you must wait one day (cooldown) before buying again. Return the maximum profit. The input is JSON {prices}.
Input: JSON {prices}.
Output: Integer — the maximum profit.
Input: {"prices":[1,2,3,0,2]}
Output: 3
Explanation: Buy, sell, cooldown, buy, sell.Input: {"prices":[1]}
Output: 0
Explanation: No transaction.Input: {"prices":[2,1,4]}
Output: 3
Explanation: Buy at 1, sell at 4.1<=n<=5000