Range Sum Query 2D Mutable
You run a grid of weather monitoring stations, each reporting the rainfall captured at one lattice cell of a continentspan field. Readings shift whenever a sensor is recalibrated, and researchers constantly ask for the total rainfall across a rectangular patch. Because the values change frequently, a one-time prefix table goes stale the moment any sensor is retuned. Design a system that handles both kinds of requests efficiently: refreshing a single cell to a new reading, and summing every cell inside an axis-aligned rectangle. The two operations interleave arbitrarily, so an update can re-run a sensor immediately after a query reports on it.