A PayPal Zettle checkout terminal must return change using a supplied set of coin denominations. Given unlimited coins of each denomination and a target amount, return the minimum number of coins required to make exactly that amount. Return -1 if the amount cannot be formed.
Implement coin_change(coins, amount), where coins is a list of positive integers representing available denominations and amount is a non-negative integer. Return an integer containing the fewest coins needed, or -1 when no combination produces the target amount. Each denomination may be used any number of times, and coin order does not matter.
def coin_change(coins, amount):