买卖股票的最佳时机Ⅱ(峰谷法)

今天遇到了一个十分牛逼的算法 先把代码贴上来 题目在leetcode里web int maxProfit(int* prices, int pricesSize){ int i = 0; int valley = prices[0]; int peak = prices[0]; int sum = 0; while(i < pricesSize-1){
相关文章
相关标签/搜索