You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_308.java
+13-10Lines changed: 13 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
1
packagecom.fishercoder.solutions;
2
2
3
3
/**
4
-
* Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
4
+
* 308. Range Sum Query 2D - Mutable
5
+
*
6
+
* Given a 2D matrix matrix,
7
+
* find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
5
8
6
9
Range Sum Query 2D
7
10
The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, col2) = (4, 3), which contains sum = 8.
@@ -24,7 +27,7 @@ The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) an
24
27
You may assume that row1 ≤ row2 and col1 ≤ col2.
25
28
*/
26
29
publicclass_308 {
27
-
classSolution {
30
+
publicstaticclassSolution1 {
28
31
publicclassNumMatrix {
29
32
int[][] nums;
30
33
int[][] tree;
@@ -63,7 +66,8 @@ public int sumRegion(int row1, int col1, int row2, int col2) {
0 commit comments