<qiyuangong>063_Unique_Paths_II_1.py
def uniquePathsWithObstacles( obstacleGrid):
    m, n = len(obstacleGrid), len(obstacleGrid[0])
    dmap = [[0] * n for _ in range(m)]
    for i in range(m):
        if obstacleGrid[i][0] != 1:
            dmap[i][0] = 1
        else:
            break
    for j in range(n):
        if obstacleGrid[0][j] != 1:
            dmap[0][j] = 1
        else:
            break
    for i in range(1, m):
        for j in range(1, n):
            if obstacleGrid[i][j] == 1:
                continue
            l = u = 0
            if i - 1 >= 0:
                u = dmap[i - 1][j]
            if j - 1 >= 0:
                l = dmap[i][j - 1]
            dmap[i][j] = l + u
    return dmap[m - 1][n - 1]
def sample_funcname ( var_0 ) :
    var_2 , var_4 = len ( var_0 ) , len ( var_0 [ 0 ] )
    var_7 = [ [ 0 ] * var_4 for var_5 in range ( var_2 ) ]
    for var_8 in range ( var_2 ) :
        if var_0 [ var_8 ] [ 0 ] != 1 :
            var_7 [ var_8 ] [ 0 ] = 1
        else :
            break
    for var_10 in range ( var_4 ) :
        if var_0 [ 0 ] [ var_10 ] != 1 :
            var_7 [ 0 ] [ var_10 ] = 1
        else :
            break
    for var_8 in range ( 1 , var_2 ) :
        for var_10 in range ( 1 , var_4 ) :
            if var_0 [ var_8 ] [ var_10 ] == 1 :
                continue
            var_12 = var_11 = 0
            if var_8 - 1 >= 0 :
                var_11 = var_7 [ var_8 - 1 ] [ var_10 ]
            if var_10 - 1 >= 0 :
                var_12 = var_7 [ var_8 ] [ var_10 - 1 ]
            var_7 [ var_8 ] [ var_10 ] = var_12 + var_11
    return var_7 [ var_2 - 1 ] [ var_4 - 1 ]
