LeetCode初级算法-数组-2

题目:买卖股票的最佳时机 II C语言解题 int maxProfit(int* prices, int pricesSize) { int i, profit=0; if (pricesSize == 0) { return 0; } for (i = 1; i < pricesSize; i++) { if (prices[i] > prices[i - 1]) {
相关文章
相关标签/搜索