Prefix Sum: The O(1) Range Query Trick That Turns Nested Loops Into One Pass (Like a Running Total on Your Receipt) Imagine this: you have an array and someone asks "what's the sum from index i to j?" ...