AlgoMaster Logo

Range Sum Query - Immutable

nums=[-2, 0, 3, -5, 2, -1],left=0,right=2
0 / 10
numsprefix0123456-203-52-10
algomaster.io
Step:Start: prefix[0] = 0, then build the prefix sum array left to right