🧠 Drill · Think it through
Counting ways to make change
The problem
You have an unlimited supply of coins in a few fixed denominations, say {1, 2, 5}. Given an amount, return the number of distinct ways to make exactly that amount. Order doesn't matter, so 1+2 and 2+1 count as the same way. The same smaller amounts keep coming up as you work toward the total, and the answer for a big amount is built from the answers for smaller amounts.
Don't jump to code. Walk the four questions an expert asks first — you'll build the habit, not just the answer.
1
Restate it
Before anything else — did you read what's actually being asked? Strip the story to the bare goal.
Strip away the story. What are we actually asked to return?