<filename>array/122_best_time_to_buy_and_sell_stock_ii.py
class Solution(object):
    def maxProfit(self, prices):
        """
        :type prices: List[int]
        :rtype: int
        """
        s = 0
        for i in range(1, len(prices)):
            diff = prices[i] - prices[i - 1]
            s += max(diff, 0)
        return s


solver = Solution()
ans = solver.maxProfit([1,2,3,4,5])
print(ans)
<filename>array/122_best_time_to_buy_and_sell_stock_ii.py
class Solution(object):
    def maxProfit(self, prices):
        """
        :type prices: List[int]
        :rtype: int
        """
        s = 0
        for i in range(1, len(prices)):
            diff = prices[i] - prices[i - 1]
            s += max(diff, 0)
        return s


solver = Solution()
ans = solver.maxProfit([1,2,3,4,5])
print(ans)
:type prices: List[int]         :rtype: int