maxProfit = (prices) => {
    let [ sold, held, reset ] = [ (-Infinity), (-Infinity), 0 ];

    [ sold, reset ] = search(prices, sold, held, reset);/* Time O(N) */

    return Math.max(sold, reset);
}
Greedy - State Machine
Time O(N) | Space O(1)
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/
@param {number[]} prices
@return {number}