Best Time to Buy and Sell Stock II
class Solution(object):
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
result = 0
for i in xrange(1, len(prices)):
if prices[i] - prices[i-1] >0:
result += prices[i] - prices[i-1]
return resultLast updated