Welcome to the Monastery | |
PerlMonks |
Re: Calculate prime factors for a given numer in a perl one-linerby kennethk (Abbot) |
on Dec 15, 2010 at 18:03 UTC ( [id://877332]=note: print w/replies, xml ) | Need Help?? |
I wouldn't say so. I just wrote one up that consisted of a single if-else in a while loop - no fancy special variables or built-ins. It seems to me that your current approach is overthinking the problem a bit. For example, there is no need to store the factors if the whole goal is outputting them, and my solution does not involve precomputing prime numbers.
Giving hints without giving solutions is hard.
In Section
Seekers of Perl Wisdom
|
|