I have run this code on my machine and it finished in 53.5 minutes. I am not really shocked by this but I am impressed. The only optimizations the C code attempts to make is by limiting the number of the 17 trillion different sets it visits. Adding in a cache and some other neat doo-dads could probably blow this 53.5 minutes out of the water - but why bother. That is one of the beauties of Perl. The amount of time it would take to devise a C program to beat the Perl is more than time than it takes the Perl to run. Good Job.
Cheers - L~R
In reply to Re^12: Challenge: Number of unique ways to reach target sum
by Limbic~Region
in thread Challenge: Number of unique ways to reach target sum
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |