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.
Are you saying to return the parameter passed into the function?
Print the input value, and if needed, other values to debug your code.
This comment is hidden because it contains spoiler information about the solution
Changing my solution to add an additional string did pass the random attempt tests. Presumably then the Codewars interface was flipping the specific string passed in as input to use as expected output and undoing the flipping done by my previous solution to leave it the same, whereas the sample tests have separate input and output strings, confusing at the time but I think that all makes sense now. Thanks for your responses.
You are not allowed to modify a buffer returned by
c_str
.strtok
mutates the string it operates on.const_cast
shoudl give you a hint that you are doing something wrong.It's a bug in your solution, not a kata issue.
Language is C++
what language?
Expected result strings don't seem to be getting words flipped on Random_Sentences_Tests when making attempts. For example for the random input "still like of for pizza they are I are" my script produces "llits like of for azzip they are I are" but the expected string is "still like of for pizza they are I are".