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.
Well I just learned a new method. Very clean solution!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
not entirely sure what you meant (the C++ tests are so incomplete that they dont even use
std::string
) but I added#include <string>
to the initial code where it was indeed missing. Also rewrote the assertions to use theExtraMessage()
parameter instead of printing to the consoleand done for Ruby
the error comes from your code, you are not
end
ing yourdo
loopThe Ruby translation seems to have a syntax error in the tests:
What's the purpose of having @output? I thought that was used for class variables.
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.This comment is hidden because it contains spoiler information about the solution
Loading more items...