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.
It seems to me that there is some kind of error with the tests, I pass the Sample_tests, but I cannot pass the Basic_tests, although, as I understand it, they contain the same tests as in the Sample_tests. Am I wrong?
IMHO in C++ the right way to do that would not be to templatize the sh.., but much simpler to behave like some STL algorithms and have a "ring class contructor" taking begin() and end() as parms.
I rank it 4 kyu "Advanced design patterns"...
Great problem. It's refressing to see threading instead of the usual iteration or string parsing.
One small issue is that the times in the sample test are incorrect in the C++ translation. The second comment should be
1.999 seconds
and the third should be2.001 seconds
.usleep(1000000); Assert::That(calledBack.load(), Equals(0)); // 1 second passed usleep(999000); Assert::That(calledBack.load(), Equals(0)); // 4.999 seconds usleep(2000); Assert::That(calledBack.load(), Equals(1)); // 5.001 seconds
This comment is hidden because it contains spoiler information about the solution
Python translation:
https://www.codewars.com/kumite/5fb6508618f1e7000a7a82ed?sel=5fb6508618f1e7000a7a82ed
From this it seems that the class owns the container, but solutions that use the container by reference also pass. It should be clarified and the tests should match the description.
Duplicate of https://www.codewars.com/kata/558aa460dcfb4a94c40001d7
In the example tests:
Aren't they equal? incase if they are not, then the same code passes the full test suite, something needs to be fixed.