Concept Flow - Prefix Sum Array
Start with input array
Create prefix sum array with same length
Set prefixSum[0
For each index i from 1 to end
Calculate prefixSum[i
Repeat until end of array
Prefix sum array ready for queries
We start with the input array and build a new array where each element is the sum of all elements up to that index.
