I'm down to 111 characters at
Re^2: Golf: Buying with exact change using Anonymonk's non-regex solution. I think that with the addition of a few characters, you might be able to remove the 999 restriction on the regex solution.
Update: Melding our solutions gives a 79 character solution that doesn't have the 999 restriction.
$"="}|1{";$r=qr/^(1{@_})+$/;for($t=$s=0;$t-$s<$_[0];(1x++$t)=~/$r/ or$
+s=$t){}$s
|
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.