Ad
  • Default User Avatar

    In the solution setup, under the declaration, there is this comment:

    /* Please modify the string in-place and return it.
     */
    

    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.