Concept Flow - Buy and Sell Stocks All Variants
Start with prices array
Choose variant: single, multiple, cooldown, fee
Initialize variables: buy, sell, cooldown, fee
Iterate over prices
Update buy/sell states based on variant rules
At end, return max profit
Done
The flow starts with the prices array, selects the variant, updates buy/sell states per day, and ends with the max profit.