摘要: 比较简单常见的股票买卖问题,不限制交易的次数而去得最大利润。 思路一: 其实很好理解,想获得最大利润,我们可以遍历数组,直接把所有股票的上升阶段都加起来即可。 public int maxProfit(int[] prices) { int maxProfit=0; for(int i=0;i<pr 阅读全文
posted @ 2021-08-22 11:21 毅毅毅毅毅 阅读(47) 评论(0) 推荐(0)