Problems > Trade Every Rise > Editorial

Trade Every Rise — Solution & Editorial

Back to the Problem

Every upward day-to-day move can be captured independently: sum all positive differences (an exchange argument shows nothing better exists).

Complexity: O(N)