Ad
  • Custom User Avatar

    Are you saying to return the parameter passed into the function?

  • Custom User Avatar

    Print the input value, and if needed, other values to debug your code.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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.

  • Custom User Avatar

    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.

  • Default User Avatar
  • Custom User Avatar

    what language?

  • Default User Avatar

    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".