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.
Your code fails with input values like this one:
assertFalse("372436920 is not prime", Prime.isPrime(372436920));
and that's a problem with your code, not a kata issue.That negative number you see there (not sure why) is not the input value of the test your code is failing, add
System.out.println(num + "\n");
to your function to see the input.Java submission test includes a failing test for -2147483647, which should not be prime, and my function does not mark it prime as far as I can tell. If I write this condition into the tests manually it succeeds.
Fixed
Approved for the sake of updating to latest version
Javascript fork to enable Node v14 and improved random tests.
Addresses this issue
This comment is hidden because it contains spoiler information about the solution
I like this. It doesn't lean on Data.Char, doesn't redirect to additional functions (like my first attempt), and each line is crystal clear what it's doing. You could reverse engineer the plain English spec from this code.