in reply to Calculate prime factors for a given numer in a perl one-liner

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.

  • Comment on Re: Calculate prime factors for a given numer in a perl one-liner

Replies are listed 'Best First'.
Re^2: Calculate prime factors for a given numer in a perl one-liner
by andmott (Acolyte) on Dec 15, 2010 at 18:07 UTC
    Thanks for the feedback and hint I appreciate it!