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
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