def maxProfitDelta(self, prices):
        if len(prices) <= 1:
            return 0
        delta_prices = []
        for i in xrange(1, len(prices)):
            delta_prices.append(prices[i]-prices[i-1])

        # O(n)
        # notice: possible to do nothing thus profit at least is 0 
        max_sub_array = 0
        current_sub_array = 0
        for j in xrange(len(delta_prices)):
            current_sub_array = max(0, current_sub_array+delta_prices[j])
            max_sub_array = max(max_sub_array, current_sub_array)

        return max_sub_array
Get the offset matrix or translate between the source and the destination skeletons
dataset/ETHPy150Open algorhythms/LeetCode/122 Best Time to Buy and Sell Stock.py/Solution.maxProfitDelta--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/app/hik/retargeter.py/DefaultRetargeter.calculateOffsets