23. Coin Change
Given coin denominations and an amount, return the minimum number of coins needed, or -1 if the amount cannot be formed.
範例 1:
輸入: coins = [1,2,5], amount = 11 輸出: 3
範例 2:
輸入: coins = [2], amount = 3 輸出: -1
限制條件:
1 <= coins.length <= 120 <= amount <= 10^4