Suppose you want to solve a problem in which there is a
In this implementation an Order Statistics Tree(more about [](http://codeforces.net/blog/entry/11080)) is embedded at each node in a BIT. It only works if a 2D BIT has to be implemented for a binary grid of numbers(grid filled with only 1s and 0s). The update()
function has been broken into 2 functions — insert()
(to insert a 1 in the grid at a given point) and remove()
(to remove a 1 from the grid).
PS: Suggestions are welcome. Please notify if there are any mistakes.