122. 买卖股票的最佳时机 II - 力扣(LeetCode) class Solution {public int maxProfit(int[] prices) {if(prices.length == 0){return 0;}int min = prices[0];int result = 0;for(int i=1;i<prices.length;i++){if(
122.买卖股票的最佳时机 II 题目链接:https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/ 文档讲解:https://programmercarl.com/0122.%E4%B9%B0%E5%8D%96%E8%82%A1%E7%A5%A8%E7%9A%84%E6%9C%80%E4%BD%B3%E… 视频讲解:ht
22.买卖股票的最佳时机II public static int maxProfit(int[] prices) {//买 如果后面的价格有比当前的价格大.反之不买//卖 如果后面的价格有比当前的价格小,反之不卖int currentProfitMoney = 0;boolean flag = false;for (int i = 0; i < prices.length; i++)