Answers for "coin change 2"

0

coin change 2

vector<int> dp(amount+1, 0);
dp[0] = 1;
for (auto coin : coins)
    for (int i=1; i<=amount; i++)
        if (coin <= i) dp[i] += dp[i-coin];
return dp[amount];
Posted by: Guest on October-09-2021

Browse Popular Code Answers by Language