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 did that, but it's still taking too long because of how large the numbers are. I've been stuck with this all day.
You could try storing primes in a global/static variable. That way you only calculate them once during the first function call.
I know this feeling! I've been recently learning haskell and when i see other people's solution i'm like wow!, i'm still super bad at this. haha
Can somebody give me a hint for a python solution? I have optimized the prime number searching function using sieve of Eratosthenes algorithm but the main function is taking very long time.
I am stuck with python. I have used very fast method for searching prime_numbers, but still timeout. Don't know where I am messing up.
This solution is actually fast. I ran double(30, 20000) for the above solution and my solution without the "if b > 0.00000000001" part. my solution took 565ms wheras above solution took 165ms.same code but way faster.
This comment is hidden because it contains spoiler information about the solution
This was one hell of a good kata. Spend whole day and just got it done with python. Now watching other people's solution and I just realised I know nothing. People are just way smarter. Bookmarking this. Will come back later and practice other people's solution.
Damn! you and I followed exactly the same way. i have wrote the exact same for loop and thus excution time ran out but after someday I wrote the following code and it worked.
This comment is hidden because it contains spoiler information about the solution