Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This can speed the calculation to
Here's the resulting faster variant of my script: (Update: I've removed the redundant code from this snippet, as noted on Re: Challenge: Number of unique ways to reach target sum and updated the benchmarks accordingly) This of course works only in those solutions which calculate the number of possibilities only, not for those that iterate on them all. Update: blokhead's reply has another interesting optimization. Update: like blokhead does makes it even more faster (with 40%). Here's the newer code.Update: Improving this a tad bit more, we get In reply to Re: Challenge: Number of unique ways to reach target sum
by ambrus
|
|