A Nissan Motor payment kiosk accepts a fixed set of coin denominations. Given the denominations and a target amount, return the minimum number of coins needed to produce that amount. Each denomination may be used any number of times. Return -1 if the amount cannot be formed.
Implement coin_change(coins, amount), where coins is a list of positive integers and amount is a non-negative integer. Return an integer representing the smallest number of coins whose values sum to amount, or -1 when no valid combination exists.
def coin_change(coins, amount):