代码随想录算法训练营day50| 123.买卖股票的最佳时机III、188.买卖股票的最佳时机IV
Leetcode123.买卖股票的最佳时机III题目链接思路:动态规划代码:classSolution{publicintmaxProfit(int[]prices){if(prices.length==0){return0;}/**定义5种状态:*0:没有操作,1:第一次买入,2:第一次卖出,3:第二次买入,4:第二次卖出*/int[][]dp=newint[prices.length][5];