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.
in Haskell using a sieve of Erathostenes does not offer running time of below 12,000ms. I assume this is because the sieve is recomputed at each call to gap function.
Can you acknowledge that in your case you are using some static storage for the sieve ?
I would like to mention that you can use a list to store the primes. I used an O(n) sieve of eratosthenes and my solution passed.
Except there're only 100 tests in JavaScript (which I suppose you're using), so no, your solution is simply bad.
Avoid the idea of using a list for storing the numbers.
This helped me beat the timeout error.
Not an issue. Implementing a solution efficient enough to pass the tests in time is a part of the task, whether you like it or not.