mat of size n x n with all zeros.[row1, col1, row2, col2]:
a. Increment mat[row1][col1] by 1 (top-left corner).
b. Decrement mat[row1][col2 + 1] by 1 if col2 + 1 < n (just outside the right edge).
c. Decrement mat[row2 + 1][col1] by 1 if row2 + 1 < n (just outside the bottom edge).
d. Increment mat[row2 + 1][col2 + 1] by 1 if both row2 + 1 < n and col2 + 1 < n (bottom-right corner outside the submatrix).mat.