Ad
  • Custom User Avatar

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

  • Custom User Avatar

    common mistake: you are using strcat() on uninitialized memory. strcat() will scan for the first nul byte (\0) in a string and start writing there. Your code assumes that ordered starts with a nul byte, but the function's contract makes no such promise: it is an output parameter, so you must treat it as if it could contain arbitrary bytes before you write to it. I have updated the tests to make your code fail consistently.