提交:
class SubrectangleQueries: def __init__(self, rectangle: List[List[int]]): self.list = rectangle def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None: for i in range(row1,row2+1): for j in range(col1,col2+1): self.list[i][j] = newValue def getValue(self, row: int, col: int) -> int: return self.list[row][col]
原文:https://www.cnblogs.com/oldby/p/13153806.html