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.
In the solution setup, under the declaration, there is this comment:
Granted, this is not the same as C++ or maybe any other language, but this comment explains exactly what to do. So, in fact the random tests are working correctly. This confusion arises instead due to all other tests, because they test a fresh string literal against whatever your return, whether you complied with the directive given in the comment or did something else.
It's a bug, there's no question about it.
There is 100% a bug in the C RandomTests suite.
The bug is that it expects the input string to be modified in place, and it ignores the return value of your "correct" function.
There is no equivalent bug in C++, nor is there an equivalent bug in the C BasicTests suite.
This requirement is not stated in the problem, and is unique to one specific test suite in one specific language. It's a bug.
The workaround to meet this secret requirement is that you need to overwrite the input string with the result, before you return the result. That way, the broken RandomTests suite passes.
There is 100% a bug in the C RandomTests suite.
The bug is that it expects the input string to be modified in place, and it ignores the return value of your "correct" function.
There is no equivalent bug in C++, nor is there an equivalent bug in the C BasicTests suite.
This requirement is not stated in the problem, and is unique to one specific test suite in one specific language. It's a bug.
The workaround to meet this secret requirement is that you need to overwrite the input string with the result, before you return the result. That way, the broken RandomTests suite passes.
There is 100% a bug in the C RandomTests suite.
The bug is that it expects the input string to be modified in place, and it ignores the return value of your "correct" function.
There is no equivalent bug in C++, nor is there an equivalent bug in the C BasicTests suite.
This requirement is not stated in the problem, and is unique to one specific test suite in one specific language. It's a bug.
The workaround to meet this secret requirement is that you need to overwrite the input string with the result, before you return the result. That way, the broken RandomTests suite passes.