Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Some nitpicks if you allow. :)
You know, you could considerably speed up your algorithm by not looping over all results so far in foreach my $c (keys %{$w}) but only those new from the last run. There is no point checking the smaller sums again and again. And resorting to bash and grep to find the smallest result could be easily avoided by exiting Perl as soon as a sum is missing in %$w Furthermore, and this is more stylistic, using a hash-slice might be easier to read.
Hope this helps! =) In reply to Re: Stamp puzzle solution
by Anonymous Monk
|
|