Range Sum Query 2D - Mutable
Example
Input:
NumMatrix(
[[3,0,1,4,2],
[5,6,3,2,1],
[1,2,0,1,5],
[4,1,0,1,7],
[1,0,3,0,5]]
)
sumRegion(2,1,4,3)
update(3,2,2)
sumRegion(2,1,4,3)
Output:
8
10Notice
Last updated