Best Time to Buy and Sell Stock IV
You are given an integer array
prices where prices[i] is the price of a given stock on the i^{th} day, and an integer k representing the maximum number of transactions allowed. A single transaction consists of one purchase and one subsequent sale. You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again). Return the maximum profit you can achieve with at most k transactions.JavaDPGreedy
00