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.
hELLO WORLD
I was sure there is something like that, but couldn't find it. Thank you
This code was checked number (prime) 11 004 979 in 5 770 000 nanoseconds
This code was checked number 2 000 000 000 in 450 000 nanoseconds
Certainty should be adjusted to a problem, there is no simple answer. For this Kata's task even 1 is enough as it should pass tests only once and won't be used anymore.
welcome
Great job! I learn a new method thanks to you
"Classic" implementation with
Math.sqrt()
is faster and, as YangF0917 mentioned,Excellent! Good thing I didn't know that method existed :D
I mean no matter how many times you run the test, there will be still a marginal chance that the code fails to identify whether the number is prime or composite. That is just the nature of probabilistic prime checking.