Exercises/#52 Coin Change
#52

Coin Change

Medium🧩 Dynamic Programming
90 XP

Problem

Given coins of different denominations and an amount, find the fewest coins needed to make up that amount. Return -1 if not possible.

Examples

Input: coins=[1,5,11], amount=15
Output: 3 (5+5+5)

Input: coins=[2], amount=3
Output: -1
dynamic-programmingbfs
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

52 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features