Ad
  • Custom User Avatar
  • Custom User Avatar

    Whoa nelly. I was digging deep into academic papers for fast prime factorization algorithms because even pre-calculating all primes up to numbers like 36,540,001 was just not cutting the mustard. If like me you keep timing out and are looking for a spoiler-free hint: checking if a number is prime is much faster than generating a list of primes, so anywhere you can just check if a number is prime and exit, do that.

  • Custom User Avatar
  • Custom User Avatar

    I fixed this by clearing the original queue arrays in the queues array given to the function, though it wasn't necessary for my algorithm to produce the correct result.

    What does this mean? How do you "clear the original queue arrays in the queues array given to the function"