leetcode-1476-子矩形查询

 

 提交:

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]

 

posted @ 2020-06-17 17:44  oldby  阅读(143)  评论(0编辑  收藏  举报