Prefix sums
Each day you put coins into a jar or take a few out. How can you quickly find the change over any three days? Record the running total after each day once.
Cell prefix[i] holds the sum of the first i numbers. Add the number at index i to get the next total.
Subtract the total before start from the total before stop. This removes every change before the selected range.
Building the table takes O(n) time and space. Each later range needs two reads and one subtraction, or O(1) time.