You are given an array `prices` where `prices[i]` is the price of a given stock on the `i-th` day. Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times) with the following restrictions: After you sell your stock, you cannot buy stock on the next day (i.e., cooldown one day).
State Machine / Dynamic Programming
At any given day, we can be in one of three states: 1. **Buying**: We just bought a stock or were already holding. 2. **Selling**: We just sold a stock. 3. **Cooldown**: We are resting after a sale. By tracking the maximum profit for each state on each day, we can derive the overall maximum.