Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Puzzle: What is the largest integer whose digits are all different (and do not include 0) that is divisible by each of its individual digits?by fizbin (Chaplain) |
on Oct 27, 2005 at 14:31 UTC ( [id://503351]=note: print w/replies, xml ) | Need Help?? |
I must say, I'm a bit surprised by the times other people are getting - as written above, my program takes about 1 second on my relatively underpowered laptop. (1.3 Ghz Pentium something, 512 MB ram) Even if you simplify my program down by removing both "elsif" blocks you're only up to about 2.5 seconds. Removing the "if ($ndig == 1)" block does bring you up to 34 seconds.
--
In Section
Seekers of Perl Wisdom
|
|