mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Fix a definition.
This commit is contained in:
@ -31,7 +31,7 @@ public class coin_change_ii {
|
||||
return dp[n, amt];
|
||||
}
|
||||
|
||||
/* 零钱兑换 II:状态压缩后的动态规划 */
|
||||
/* 零钱兑换 II:空间优化后的动态规划 */
|
||||
public int coinChangeIIDPComp(int[] coins, int amt) {
|
||||
int n = coins.Length;
|
||||
// 初始化 dp 表
|
||||
@ -61,7 +61,7 @@ public class coin_change_ii {
|
||||
int res = coinChangeIIDP(coins, amt);
|
||||
Console.WriteLine("凑出目标金额的硬币组合数量为 " + res);
|
||||
|
||||
// 状态压缩后的动态规划
|
||||
// 空间优化后的动态规划
|
||||
res = coinChangeIIDPComp(coins, amt);
|
||||
Console.WriteLine("凑出目标金额的硬币组合数量为 " + res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user