Coin Change - Find Possibilities and Count Possibilities.
Given a list of coin values and a target sum, write a function to determine the minimum quantity of coins needed to reach the exact target sum. If it is impossible to reach that sum with the given coins, return -1
.
Example 1:
Coins: [1, 3, 4], Target: 6 Result: 2 Explanation: 6 = 3 + 3
Example 2:
Coins:[2, 7], Target: 5 Result: -1