Original
Diff array
Result
Updated range

Controls

Range update: O(1) | Build result: O(n)

Operations

0 steps

Press Run Demo to trace the algorithm one step at a time.