Skip to content

Commit

Permalink
➕增加 leetcode
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcaffebabe committed Apr 26, 2021
1 parent 110dec5 commit 761590d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions 算法与数据结构/leetcode/leetcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -3323,3 +3323,30 @@ class Solution {
```

time:18 beat:8

## 1476. 子矩形查询

<https://leetcode-cn.com/problems/subrectangle-queries/>

```java
class SubrectangleQueries {
private int[][] rectangle;
public SubrectangleQueries(int[][] rectangle) {
this.rectangle = rectangle;
}

public void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
for(int i = row1;i<= row2;i++){
for(int j = col1;j<=col2;j++){
rectangle[i][j] = newValue;
}
}
}

public int getValue(int row, int col) {
return rectangle[row][col];
}
}
```

time: 30 beat:86

0 comments on commit 761590d

Please sign in to comment.