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.
Yes it is. Nowhere does the kata mention that the answer must address a particularly high performance constraint. It just says you have to find the earliest gap between primes in a set interval, and my algorithm does just that, and in a few milliseconds, which is hard to beat in the first place. It just doesn't pass because the amount of tests in unreasonably high. Anyone can order millions of tests to pass a kata and thus force valid solutions to timeout. It's just stupid and the only thing it does is create frustration in those who've actually put time and effort in putting together those solutions. Feel free to differ, but from what I've read in the comments, you should at least acknowledge many feel that way.
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.
This comment is hidden because it contains spoiler information about the solution
The description should mention whether the odd characters or the even characters should come first when concatenated instead of leaving people guessing.