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