feat(go): support binary search & fix comments (#691)

This commit is contained in:
Reanon
2023-08-23 21:32:40 +08:00
committed by GitHub
parent 1aa558bd2d
commit 628a274b50
4 changed files with 118 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ func coinChangeIIDP(coins []int, amt int) int {
// 若超过背包容量,则不选硬币 i
dp[i][a] = dp[i-1][a]
} else {
// 不选和选硬币 i 这两种方案的较小值
// 不选和选硬币 i 这两种方案之和
dp[i][a] = dp[i-1][a] + dp[i][a-coins[i-1]]
}
}