LeetCode——Best Time to Buy and Sell Stock II
public int maxProfit(int[] prices) {
int profit = 0, start = prices[0];
//Solution1: 寻找最多的递增子序列,利润加总
// for(int i=1; i<prices.length; i++) {
// if(prices[i] > prices[i-1]) {
// continue;
//
原创
2014-08-09 15:21:20 ·
431 阅读 ·
0 评论