Pernambuco Ruby User Group
What is the minimum set of bills that sums up to a given amount of money? Assume the machine is provided an unlimited amount of bills in the following values: 2, 5, 10, 20, 50 and 100.
$ bin/atm 107 248
For $ 107:
1 * $ 100
1 * $ 5
1 * $ 2
For $ 248:
2 * $ 100
2 * $ 20
4 * $ 2
$ bin/atm 11
Unable to withdraw $ 11.
$ gem install bundler
$ bundle install
$ autotest
If you don't like autotest and autotest-growl, just run:
$ bundle install --without autotest
- Fork it
- Change it
- Red, yellow, green
- Send a pull request
Mail us at frevo-on-rails@googlegroups.com if you need help.