Practice Problem

Best Time to Buy and Sell Stock III

Difficulty: Hard

Find the maximum profit from at most two stock transactions, where you must sell before buying again.