Please help me with some doubts, I was reading 2D BIT, gfg implementation https://www.geeksforgeeks.org/two-dimensional-binary-indexed-tree-or-fenwick-tree/
In the updateBit and getSum function inner loop, "y" is not initialized again, can someone explain me how is it working and what is the need of outer loop as the same work can be done with the help of an "if" statement.
Thanks in advance..