Given a list of coin denominations and a target amount, return the minimum number of coins needed to make amount. Return -1 if it's impossible.
Examples
solve([1, 5, 10, 25], 36) → 3 (25 + 10 + 1)solve([2], 3) → -1solve([1], 0) → 0Constraints
O(amount × len(coins))).1 ≤ len(coins) ≤ 12, 0 ≤ amount ≤ 10_000.Sample tests