MethodspiralOrderBUse rMin, rMax, cMin, cMax, to store the boundries Use i, j to track the position Move i, j around to add elements Break whenever out of bounds to avo
src/main/java/com/freetymekiyan/algorithms/level/medium/SpiralMatrix.java:69
MethodsumRegionA: Sum of (0, 0) to (row2, col2) is dp[row2 + 1][col2 + 1] B: Sum of (0, 0) to (row1 - 1, col2) is dp[row1][col2 + 1] C: Sum of (0, 0) to (row2, col1
src/main/java/com/freetymekiyan/algorithms/level/medium/RangeSumQuery2DImmutable.java:65