Problems > Consecutive Differences > Editorial

Consecutive Differences — Solution & Editorial

Back to the Problem

One pass of pairwise subtraction — the discrete derivative that inverts prefix sums.

Complexity: O(N)