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.
How long does your program run for
1992104689
? How long does it run for1999999817
?First of all, be careful when disclosing your solution or approach in the discourse. Even if it doesn't work, you risk spoiling the fun for others who are trying to discover methods of their own.
Secondly, inputs go up to 2^31 as stated in the description. Iterating over that range is bound to fail, as worst case complexity is O(n) (the number may be prime).
Dealing with primes generally requires a slightly more sophisticated approach. I recommend just doing some research; a good starting point is here.