You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a value V, if we want to make change for V cents, and we have infinite supply of each of C = { C1, C2, .. , Cm} valued coins, what is the minimum number of coins to make the change?
Example
Input
4 4
1 2 3 5
Output
2
Explanation
We can make 4 using {2,2} or {1,3}
*/
// m is size of coins array (number of different coins)
int minCoins(vector<int> coins, int m, int V)
{
// table[i] will be storing the minimum number of coins
// required for i value. So table[V] will have result