Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit b50a122

Browse files
aQuaaQua
aQua
authored and
aQua
committed
416 finish
1 parent 4dfaf38 commit b50a122

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ func canPartition(nums []int) bool {
2222
dp[i] = make([]bool, sum+1)
2323
}
2424

25-
// 从任意多个元素中,挑选 0 个元素出来,其和总是 0
26-
dp[0][0] = true
27-
for i = 1; i < n+1; i++ {
25+
for i = 0; i < n+1; i++ {
26+
// 从任意多个元素中,挑选 0 个元素出来,其和是 0
2827
dp[i][0] = true
2928
}
3029

0 commit comments

Comments
 (0)