<p>What is a <strong>non recursive</strong> algorithm for deciding whether a passed in amount can be built additively from a set of numbers.<br>
In my case I'm determining whether a certain currency amount (such as $40) can be met by adding up some combination of a set of bills (such as $5, $10 and $20 bills).  That is a simple example, but the algorithm needs to work for any currency set (some currencies use funky bill amounts and some bills may not be available at a given time).<br>
So $50 can be met with a set of ($20 and $30), but cannot be met with a set of ($20 and $40).  The non-recursive requirement is due to the target code base being for <code>SQL Server 2000</code> where the support of recursion is limited.<br>
In addition this is for supporting a multi currency environment where the set of bills available may change (think a foreign currency exchange teller for example).</p>

Edit:
The following will work
some
of the time.  Think about why it won't work all the time and how you might change it to cover other cases.
Build it starting with the largest bill towards the smallest.  This will yeild the lowest number of bills.
Take the initial amount and apply the largest bill as many times as you can without going over the price.
Step to the next largest bill and apply it the same way.
Keep doing this until you are on your smallest bill.
Then check if the sum equals the target amount.