欢迎光临散文网 会员登陆 & 注册

奈学p8-Java百万架构师5期

2022-10-14 22:29 作者:芢依稀久忆0  | 我要投稿

class Solution {    public int maxProfit(int[] prices) {        int profit = 0;        for (int i = 1; i < prices.length; i++) {            if (prices[i] > prices[i - 1]) {                profit += (prices[i] - prices[i - 1]);            }        }        return profit;    }}

class Solution {    public int maxProfit(int[] prices) {      }

奈学p8-Java百万架构师5期的评论 (共 条)

分享到微博请遵守国家法律