Skip to content

Commit 37ba6bf

Browse files
aQuaaQua
aQua
authored and
aQua
committed
63 finish
1 parent fb6b21a commit 37ba6bf

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Algorithms/0063.unique-paths-ii/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ The total number of unique paths is `2`.
2020
**Note:** m and n will be at most 100.
2121

2222
## 解题思路
23-
23+
[62. Unique Paths](../0062.unique-paths)的解题思路一样。
2424
见程序注释

Algorithms/0063.unique-paths-ii/unique-paths-ii.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ func uniquePathsWithObstacles(obstacleGrid [][]int) int {
77
}
88

99
n := len(obstacleGrid[0])
10-
10+
if n == 0 {
11+
return 0
12+
}
13+
1114
dp := make([][]int, m)
1215
for i := range dp {
1316
dp[i] = make([]int, n)

Algorithms/0063.unique-paths-ii/unique-paths-ii_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ func Test_Problem0063(t *testing.T) {
7070
},
7171
ans{0},
7272
},
73+
74+
question{
75+
para{
76+
[][]int{
77+
[]int{},
78+
[]int{},
79+
},
80+
},
81+
ans{0},
82+
},
83+
7384
// 如需多个测试,可以复制上方元素。
7485
}
7586

0 commit comments

Comments
 (0)