leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1476.cpp (452B)
0 class SubrectangleQueries {
1 vector<vector<int>> &rectangle;
3 public:
4 SubrectangleQueries(vector<vector<int>> &rectangle) : rectangle(rectangle) {}
5 void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
6 for (int i = row1; i <= row2; i++)
7 for (int j = col1; j <= col2; j++)
8 rectangle[i][j] = newValue;
9 }
11 int getValue(int row, int col) { return rectangle[row][col]; }
12 };