Coin Combinations I CSES dynamic programming problem set solution -
For example, if the coins are and the desired sum is , there are ways:
The first input line has two integers and : the number of coins and the desired sum of money.
The second line has distinct integers : the value of each coin.
Print one integer: the number of ways modulo .
2 3 5