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.
bad exercise.
no libraries are blocked in this kata, there is only the code character count limit
Right? That's why I said i thought it was blocked by this kata without that rule being specified in the instructions.
That's weird, in some other kata seems to work. At least, it doesn't throw an error when importing it. Maybe it's related to the characters limit?
SciPY is on the list of available libraries in the above link, but I cannot access it for the purposes of this kata.
@abrunk read which libraries you can use here: https://docs.codewars.com/languages/python
The kata does not block Scipy, it's simply not installed on Codewars.
The kata doesn't even specify which libraries are blocked. All the formula-based ones I can find require scipy which appears to be blocked. Am I to understand that the only way to solve this is to construct the prime counting theorem from scratch? That's not really a coding exercise to to speak.
that's what I said o_O
As I understand it, "come up with" means research. Unless you are a mathematician by trade :P
those libraries are not required, you need to
come up withresearch a specific "prime counting" algorithmI guess you are supposed to implement a quick algorithm to count primes.
You have
numpy
andgmpy2
to help you dealing with a fast implementation.This seems impossible i used 6n+1, 6n-1 theorem which means that i'm reducing the loops by 66.67%.In my IDE it runs in 7.11 secs for 10000000.However here, it shows tle.
Tried several ways to do this but keep timing out at the higher levels. Anyone who completed willing to give a hint?
Is the correct solution to use a sieve to generate the primes or to use a formula to determine the number? When I try the former it keeps timing out, when I try the latter none of the libraries that have the needed functionality seem to be available.
Thanks, I figured this out.
Loading more items...