Given an array of coin denominations and an amount, return the minimum number of coins needed to make the amount, or -1 if impossible. Each coin can be used unlimited times.