Ad
  • Custom User Avatar

    Thanks, good to know!

  • Custom User Avatar

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

  • Custom User Avatar

    This mutates the original array, which was not forbidden by the description, but is probably why this rankes more on the "clever" than on the "best practice" side.
    It is really pretty clever though, I have to admit.

  • Custom User Avatar

    Nice solution. Some nitpicks:

    1. I see this a lot here, but sizeof(char) is by definition always 1, so it's kinda redundant to write that instead of just 1.
    2. Also for best practice, you should always check the return value of malloc, calloc and friends and null terminate strings.
    3. And you could realloc(final, temp - final) in the end so you don't return a buffer that is longer than it needs to be.
  • Custom User Avatar

    In that case it should be changed in the test cases. Either way, the function name in the solution stub should not have to be changed for the tests to pass. Currently you get an error (error[E0425]: unresolved name 'DNA_strand').

  • Custom User Avatar

    The Rust code misspells the function name (should be DNA_strand instead of dna_strand).