← Questions

Fewest coins when change can be given back

0
SnowflakeCodingLast asked Mar 2026

You need to pay an amount using coins of given denominations, but you may overpay and receive change back in the same denominations. Return the fewest coins that change hands in total (coins you pay plus coins you get back).

Compare it with the standard coin-change problem and explain how you bound how much overpaying can help.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding