Ad
  • Default User Avatar

    in C:

    • the reference solution should be static (and can be renamed to something more reasonable e.g. solution, since static makes the name obfuscation useless)
    • the initial code is confusing, returning the input violates const-correctness and generates a warning. Given the function's interface, the only sensible thing to do is to return a heap-allocated string (even though the tests do not free anything), so this should be indicated by a comment, and a better return value would be calloc(1, 1)