Hackerrank - Dynamic Programming - The Coin Change Problem
You have types of coins available in infinite quantities where the value of each coin is given in the array . Can you determine the number of ways of making change for units using the given types of coins? For example, if , and , we can make change for units in three ways: , , and . Given , , and , print the number of ways to make change for units using any number of coins having the values given in . Input Format The first line contains two space-separated integers describing the respective values of and . The second line contains space-separated integers describing the respective values of (the list of distinct coins available in infinite amounts). Constraints Each is guaranteed to be distinct. Hints Solve overlapping subproblems using Dynamic Programming (DP): ...