Make array non-decreasing by only increasing elements. find the lowest sum of increases. Simpler than Sonya: we can only increase, not decrease. The DP is asymmetric. = min cost for first elements, last value .
But we only pay for increases: cost = . Slope trick: track where the optimal lies. It's always at a breakpoint (one of the values). Use heap to maintain.