Best Time to Buy and Sell Stock III
Given an array
prices where prices[i] is the price of a given stock on the i-th day, design an algorithm to find the maximum profit you can achieve with at most two transactions. You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again). Your solution should ideally run in linear time and use constant extra space.JavaDP
00