solve `Exercise 3: Counting Change'

https://class.coursera.org/progfun-002/assignment/view?assignment_id=4