Python Forum
Need help with coin change program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with coin change program
#2
You need to subtract out each denomination before going on to the next one. In your example, after you give them 4 dimes, you only need to give them 7 cents more. But you try to give them 9 nickels (45 cents) because you haven't subtracted out the 40 cents from the 4 dimes.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Need help with coin change program - by Gateux - Jun-24-2019, 01:20 PM
RE: Need help with coin change program - by ichabod801 - Jun-24-2019, 01:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print the frequency of each coin for the combinations that sum to the amount N Pranav 3 2,617 May-19-2020, 06:16 AM
Last Post: Pranav
  Random module, coin flipping gus17 3 5,034 Jan-06-2020, 10:29 AM
Last Post: perfringo
  Adding and Removing coins to match Coin Bag Total infinite times Strayfe 8 4,719 Sep-11-2018, 07:30 PM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020