class Solution:
def maxProfit(self, prices: List[int]) -> int:
i=0
lens=len(prices)
maxprofits=0
for i in range(lens-1):
if prices[i]<prices[i+1]:
maxprofits=maxprofits+prices[i+1]-prices[i]
return maxprofits
我怎么感觉比股票一简单好多。。