class Solution:
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
profits = 0
for day in range(len(prices)-1):
pro = prices[day+1] - prices[day]
if pro > 0:
profits += pro
return profits
leetcode - 122 - 买卖股票的最佳时机 II
猜你喜欢
转载自blog.csdn.net/hustwayne/article/details/84930574
今日推荐
周排行