Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created March 3, 2011 02:53
Show Gist options
  • Save nerdyworm/852233 to your computer and use it in GitHub Desktop.
Save nerdyworm/852233 to your computer and use it in GitHub Desktop.
over_paid = 53
change = []
[100, 25, 10, 5, 1].each do |i|
while i <= over_paid do
if i <= over_paid
over_paid -= i
change << i
end
end
end
puts change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment