input: Write a python function to calculate the minimum number of coins needed to make a given amount using a set of coin denominations.
  assert min_coins([1, 2, 5], 11) == 3  # 5+5+1
  assert min_coins([2, 5, 10], 6) == 3  # 2+2+2
  assert min_coins([1, 3, 4], 6) == 2   # 3+3
output: def min_coins(coins, amount):
      dp = [float('inf')] * (amount + 1)
      dp[0] = 0
  
      for coin in coins:
          for x in range(coin, amount + 1):
              dp[x] = min(dp[x], dp[x - coin] + 1)
      
      return dp[amount] if dp[amount] != float('inf') else -1