Problem 2536 · Medium

Increment Submatrices by One

Mark each submatrix at its four corners in a two-dimensional difference grid, then take the prefix sums.

Open the interactive visualisation