122. Best Time to Buy and Sell Stock II

大概意思是否是只找最大差值,而是把全部的差值所有找出来it 网上某个大佬提供了一个很巧妙的思路,就是把后一个减去前一个,而后获得差值若是大于零就加上去return int maxProfit(int* prices, int pricesSize)  {     int i=1,profit=0;     for(;i<pricesSize;i++)     {         if(prices
相关文章
相关标签/搜索