Find the maximum profit from at most two stock transactions.
Constraints
Example
```python >>> max_profit_twice([3, 3, 5, 0, 0, 3, 1, 4]) 6 >>> max_profit_twice([1, 2, 3, 4, 5]) 4 >>> max_profit_twice([7, 6, 4, 3, 1]) 0 >>> max_profit_twice([1]) 0 ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints