Skip to content

Commit

Permalink
Update coin_change.c
Browse files Browse the repository at this point in the history
  • Loading branch information
krahets authored Apr 14, 2024
1 parent a78ce37 commit 0988b78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codes/c/chapter_dynamic_programming/coin_change.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int coinChangeDPComp(int coins[], int amt, int coinsSize) {
int n = coinsSize;
int MAX = amt + 1;
// 初始化 dp 表
int *dp = calloc(amt + 1, sizeof(int));
int *dp = malloc(amt + 1, sizeof(int));
for (int j = 1; j <= amt; j++) {
dp[j] = MAX;
}
Expand Down

0 comments on commit 0988b78

Please sign in to comment.