7 CoinChange
7 CoinChange
7 CoinChange
Input Format: First line of input contain two space separated integers N and M.
Second line of input contains M space separated integers - value of coins.
Sample Input: 10 4
2 5 3 6
Output Format: Output a single integer denoting the number of ways to make the
given change using given coin denominations.
Sample Output: 5
=====Solution=====
#include <iostream>
return dp[n];
}
int main()
{
long long int val[1005];
//freopen("test.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int N,M;
scanf("%d%d",&N,&M);
for(int i=0; i<M ;++i)
scanf("%lld",&val[i]);
cout<<count(val,M,N);
return 0;
}