Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I tried to check if n is a prime number when each time n changes. Hope this can help.
This implementation takes too long when n is big and can only be factorized like (2)(n') where n' is half of n(which is a big prime number).
for example, it takes a long long time to find the primeFactors(76587634333).
My implementation checkes if n is a prime number after each time n changes and it works well for all cases, although it seems long.
Hope the idea of 'checking if n is a prime number' would help you improve your algorithm.