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.
Lua translation!
n + 2 is outside the range. if n was 12, then yes, the 11-13 pair should be counted.
Well, if it's end-inclusive then for input
11
shouldn't it result in3
instead of2
since11 + 2
is also prime?Anyway, the description is still unclear imo.
How does this match with "If n is wrapped by twin primes (n-1 == prime && n+1 == prime) then that should also count even though n+1 is outside the range." ? That sounds end-inclusive ( and even slightly overinclusive, but specified unambiguously nevertheless ).
Fixed. JS tests now use identical parameters to Python.
It was not mentioned that the range is end-exclusive.
that should have fixed the issue then
the tests are missing
require 'prime'
(which is a standard Ruby module) at the top (they currently rely on the fact that the author's solution doesrequire
it)fixed here
In Ruby, I seem to have to create an alias for my function called
Prime
before the random tests will run.fixed in OP's fork
Approved
python new test framework is required. updated in this fork
Python :
Javascript reference solution is too slow to use the same range. Maybe it should be rewritten.
Yes. I solved that kata. I looked my old solution and I solved this kata. I forgetted How can I use fastly prime number calculate method. I remember again. Thank you man. Respect.
Loading more items...