**Problem Statement:**
Given the required input arguments, write an efficient algorithm to solve the **Best Time to Buy/Sell Stock III (2 Transactions)** problem. Implement the required logic as specified by standard definitions for this classic algorithmic challenge.
**Hint / Expected Approach:**
State machine: 4 states (buy1/sell1/buy2/sell2)
**Edge Cases to Consider:**
- (1) Prices strictly decreasing (no profit)
- (2) One profitable transaction
- (3) All same prices
Examples
Example 1
Input:[3,3,5,0,0,3,1,4]
Output:6
Explanation: Buy at 0, sell at 3; buy at 1, sell at 4