LeetCode 303 - Range Sum Query - Immutable with Prefix Sum: write the running total down once, and the sum of any stretch is one subtraction. Plus the one-line accumulate version, and when adding up each range every time is fine.
#coding #code #leetcode #dsa #python