The greedy method (using modulo/division):
1. Start with the current denomination = largest denomination available
2. amount of current denomination = amount / current denomination (note: using...
Type: Posts; User: helloworld922
The greedy method (using modulo/division):
1. Start with the current denomination = largest denomination available
2. amount of current denomination = amount / current denomination (note: using...
Yep, no loops should be required (luckily, most monetary systems aren't NP-hard, which can't be said for the general case). In addition to division and modulus, you'll also need addition/subtraction.