code: def minPathSum(self, grid: List[List[int]]) -> int:
      if len(grid) == 0:
          return 0
  
      for col in range(1, len(grid)):
          grid[col][0] += grid[col - 1][0]
  
      for row in range(1, len(grid[0])):
          grid[0][row] += grid[0][row - 1]
  
      for col in range(1, len(grid)):
          for row in range(1, len(grid[0])):
              grid[col][row] += min(
                  grid[col - 1][row], grid[col][row - 1]
              )
  
      return grid[-1][-1]
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.minPathSum(grid) and returns: grid, int