leetle

Daily challenge for 2025-09-21

264. Coin Change

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins needed to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

Example:
Input: coins = [1,3,4], amount = 6
Output: 2

Explanation: 6 = 3 + 3

Run this challenge interactively in Python or JavaScript when the app loads.