Skip to content

Instantly share code, notes, and snippets.

@bennidhamma
Forked from anonymous/change.py
Created November 30, 2015 21:34
Show Gist options
  • Select an option

  • Save bennidhamma/d87680ac67ae34fc132e to your computer and use it in GitHub Desktop.

Select an option

Save bennidhamma/d87680ac67ae34fc132e to your computer and use it in GitHub Desktop.
Change making problem
def makeChange(price):
...
end
# Examples:
> makeChange(0.50)
< 2 Quarters
> makeChange(0.45)
< 2 Quarters, 1 Nickel
> makeChange(0.63)
< 1 Quarter, 1 Dime, 2 Pennies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment