Least You Need to Know: Difference Arrays, Boundary Marking, and Range Updates
開啟課程
Difference arrays invert the prefix-sum idea: instead of storing cumulative totals directly, they store **where changes begin and end**. After marking update boundaries, one prefix sweep reconstructs the final values.