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 get an error during the full check, even though the numbers that give an error are not prime and are also divisible by another number.
Please show which number failed in the c++ section
Yes I'm in the same boat...
Yes, it is possible. See the "Note on performance" in the description.
The 'attempt' keeps timing out for me.
Not a kata issue. See https://docs.codewars.com/training/troubleshooting#post-discourse and https://docs.codewars.com/training/troubleshooting#timeout.
This comment is hidden because it contains spoiler information about the solution
You do not need sieve for this kata, but the problem with your sieve is that you rebuild it every time for every test (also in a somewhat inefficient way), while it could just be built once and reused between tests.
This comment is hidden because it contains spoiler information about the solution
There is no feedback on which numbers the test is passing and for which one it's failing in C++
Ask yourself, if a number is divisible by
x
, then what is its remainder after the division ? ^^This comment is hidden because it contains spoiler information about the solution
1492952653 is not prime:
1492952653 = 31 × 48159763
. The problem is with your code.This Kata doesn't work for Python. In the random tests it returns that the number 1492952653 isn't prime. Is it a fail in the Kata or in my Code?
The problem is that with
Random.Shared.Next(1, int.MaxValue)
, your tests have a very high chance to be mostly meaningless: they will generate many numbers which are very easy to solve, and very few interesting numbers, which are more difficult to solve. For example, out of 30 numbers you generated, approx. 15 of them will be even numbers, which are trivial to solve.Your tests are not great, because they do not generate interesting inputs. Your solution is apparently also not great, because it's not able to solve the interesting inputs :)
Loading more items...