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.
Python: new test framework to be used.
This comment is hidden because it contains spoiler information about the solution
You need to swap assert's arguments actual and expected results in java test cases. Currently, it's showing the actual result as expected and vice versa.
Golang Translation with Improved Testing
There are a few differences that I want to highlight:
The previous solution couldn't handle n = 10,000. It would panic with a runtime error: index out of range. The reason for the panic is that the sieve was of size 70,000 which isn't enough natural numbers to find 10,000 ludic numbers. If you attempt to increase the size of the sieve, then the process will timeout. My solution can handle n ≈ 25000 before timeout occurs.
The modifications to the test cases are to increase test coverage to include the minimum and maximum n
You should fix the sample test with Java, it's actually broken and it doesn't compile at all.
I'm getting
False should equal True
on the last testUp to one million
, when I add the check on divisibility on primes from 2 to 199.Does it mean, that reference solution fails to recognize, that number is not prime?
Needs random tests.
Add some more info about the testing: the number of tests.
Also, add some meaningful error message when people fail, instead of just
break
; e.g.There are already loads of prime related katas; although this one really goes for performance, which is good. But it's too tight: the 1.7 million(!) tests are so heavy that the same code that passes in Python 2, fails in Python 3, which is bad.
So even though I'm happy to see a performance prime testing kata (please add as a tag), I suggest to