1
class SubrectangleQueries {4
public SubrectangleQueries(int[][] rectangle) {5
this.rectangle = rectangle;8
public void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {9
for (int i = row1; i <= row2; i++) {10
for (int j = col1; j <= col2; j++) {11
rectangle[i][j] = newValue;16
public int getValue(int row, int col) {17
return this.rectangle[row][col];22
* Your SubrectangleQueries object will be instantiated and called as such: SubrectangleQueries obj23
* = new SubrectangleQueries(rectangle); obj.updateSubrectangle(row1,col1,row2,col2,newValue); int24
* param_2 = obj.getValue(row,col);