Prefix Sum pattern
A saved total lets us answer questions about a range without adding every value again.
Difficulty: Medium · Approach: Two-dimensional saved totals
Open Algorithm Atlas to watch the full interactive lesson and follow every execution step.