Given a 2D matrix, implement: - update(row, col, val): Update matrix[row][col] to val - sumRegion(row1, col1, row2, col2): Return sum of rectangle You're solving the same problem from segment trees, but 2D BIT is simpler to implement. Constraints: matrix up to , up to operations.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/data-structures/fenwick-trees/problem-range-sum-query-2d-mutable
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████████████████████████████