From 6f4c145338fe61d376bea4bcfd9175e4de840255 Mon Sep 17 00:00:00 2001 From: SunnyQjm Date: Sat, 20 Jun 2020 22:25:57 +0800 Subject: [PATCH] Update 9_unique-paths-ii.py --- chapter6/9_unique-paths-ii.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter6/9_unique-paths-ii.py b/chapter6/9_unique-paths-ii.py index b72aab1..2b31049 100644 --- a/chapter6/9_unique-paths-ii.py +++ b/chapter6/9_unique-paths-ii.py @@ -43,7 +43,7 @@ class Solution: f(i, j) = f(i + 1, j) + f(i, j + 1) i+1 < m && j+1 < n && obstacleGrid[i][j] != 1 f(i + 1, j) i+1 < m && j+1 == n && obstacleGrid[i][j] != 1 f(i, j + 1) i+1 == m && j+1 < n && obstacleGrid[i][j] != 1 - 0 (i+1 == m && j+1 == n) || obstacleGrid[i][j] != 1 + 0 (i+1 == m && j+1 == n) || obstacleGrid[i][j] == 1 """ m, n = len(obstacleGrid), len(obstacleGrid[0]) dp = [[0 for i in range(n)] for i in range(m)]