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 submitted solution is incorrent, it shouldn't have passed. I can't reproduce it now.
You lose some time with the import and use more memory by using by Numpy; also internally np.arrange performs loops and declarations so I don't know if there will be improvements. I would need to test it.
@Goncalerta: I blame the codewars viewer. That being said,
cout
shouldn't work without#include <iostream>
. I suspect hijinks in Codewars' undocumented C++ testing framework.good solution however to save a mod which is computationally heavy you can do np.arange(0, len(word), 2)
thanks lazy wolf
In regard to your question, Moagli, it sounds like you removed the "static" keyword from the race method.
The tests call the "race" method from the Tortoise class itself rather than from any instance, so the method needs to remain static.
e.g.
I see you are new at CW but note that when you ask about your code it is not an issue of the kata but only a problem
in your code so post it as a question. Issues make the author loss points:-(
Moreover you can see that 56 guys passed the kata without any problem.
BTW maybe you should learn more about C++ :-)
likely to be my fault but the class for the c++ solution is throwing me off, are we meant to declare it to include the expected result too? When I try and run an example script it says:
-isystem /runner/frameworks/cpp error: call to non-static member function without an object argument
testequal(Tortoise::race(v1, v2, g), expected);
~~~~~~~~~~^~~~
1 error generated.
Any help would be really great as I can program basic c++ but just struggling with the codewars interface/expectations.
This comment is hidden because it contains spoiler information about the solution