A prefix sum array stores cumulative sums. For array , the prefix sum equals the sum of all elements from index to .
We set by convention. So has length when has length . Why store cumulative sums?
Because any range sum you can compute from two prefix values. That's the core idea.