comefrom: <doocs>0063.Unique Paths II_1.py
code: def uniquePathsWithObstacles( obstacleGrid: List[List[int]]) -> int:
      m, n = len(obstacleGrid), len(obstacleGrid[0])
      dp = [[0] * n for _ in range(m)]
      for i in range(m):
          if obstacleGrid[i][0] == 1:
              break
          dp[i][0] = 1
      for j in range(n):
          if obstacleGrid[0][j] == 1:
              break
          dp[0][j] = 1
      for i in range(1, m):
          for j in range(1, n):
              if obstacleGrid[i][j] == 0:
                  dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
      return dp[-1][-1]
masked: def sample_funcname ( var_0 : List [ List [ int ] ] ) -> int :
      var_4 , var_6 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_9 = [ [ 0 ] * var_6 for var_7 in range ( var_4 ) ]
      for var_10 in range ( var_4 ) :
          if var_0 [ var_10 ] [ 0 ] == 1 :
              break
          var_9 [ var_10 ] [ 0 ] = 1
      for var_12 in range ( var_6 ) :
          if var_0 [ 0 ] [ var_12 ] == 1 :
              break
          var_9 [ 0 ] [ var_12 ] = 1
      for var_10 in range ( 1 , var_4 ) :
          for var_12 in range ( 1 , var_6 ) :
              if var_0 [ var_10 ] [ var_12 ] == 0 :
                  var_9 [ var_10 ] [ var_12 ] = var_9 [ var_10 - 1 ] [ var_12 ] + var_9 [ var_10 ] [ var_12 - 1 ]
      return var_9 [ - 1 ] [ - 1 ]
  