[EMAIL PROTECTED] wrote: > >Interesting impl in Python! I am wondering what if the requirement is >to find the minimum number of coins which added to the "fin" sum...
Given the set of coins in the original problem (100, 10, 5, 1, 0.5), the solution it provides will always be optimal. Even if we change this to American coinage (50, 25, 10, 5, 1), I believe it is still optimal. It is certainly possible to construct a set of denominations for which the algorithm occasionally chooses badly. For example, if you give it the set (40,35,10) and ask it to make change for 70, it will be suboptimal. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list