マツシタのお勉強

Range Sum Query 2D - Mutable : Past Google Coding Interview

Problem

https://leetcode.com/problems/range-sum-query-2d-mutable/

How to Solve

This problem can be solved by using Binary Indexed Tree. Please check below article if you want to know the details of Binary Indexed Tree.

keita-matsushita.hatenablog.com

But in this problem case, I use BIT(Binary Indexed Tree) as a 2D because input values is a matrix.

Source Code