bug&&typo: 0063不同路径II,0343整数拆分
1.bug: 0063不同路径II go版本代码 2. typo:0343整数拆分
This commit is contained in:
@@ -335,6 +335,10 @@ class Solution:
|
||||
```go
|
||||
func uniquePathsWithObstacles(obstacleGrid [][]int) int {
|
||||
m, n := len(obstacleGrid), len(obstacleGrid[0])
|
||||
//如果在起点或终点出现了障碍,直接返回0
|
||||
if obstacleGrid[m-1][n-1] == 1 || obstacleGrid[0][0] == 1 {
|
||||
return 0
|
||||
}
|
||||
// 定义一个dp数组
|
||||
dp := make([][]int, m)
|
||||
for i, _ := range dp {
|
||||
@@ -359,8 +363,6 @@ func uniquePathsWithObstacles(obstacleGrid [][]int) int {
|
||||
}
|
||||
return dp[m-1][n-1]
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
|
||||
### Javascript
|
||||
|
||||
Reference in New Issue
Block a user