Ad
  • Default User Avatar

    @th

    for any kata, you are free to create a suggestion post that provides your own personal revamped version of the description that you feel would be an improvement

    !

  • Default User Avatar

    Yes, the description is terribly! poorly written! that they let something like this go live ...

  • Default User Avatar

    Not an issue.

  • Default User Avatar
    • no room for the nul-terminator in s
    • s3 is read without having been initialized
  • Default User Avatar

    it would have been better to allocate the string beforehand yes, but it is too late now. The tests now free() the returned string, so there are no memory leaks.

  • Default User Avatar

    it is now specified in the initial code, and the tests free the returned pointer.

  • Default User Avatar
    • you need an extra byte for the nul-terminator
    • you do not nul-terminate your string
  • Default User Avatar

    your array ans is not initialized. as a result, your code's behavior is unpredictable. the tests suite cannot catch such undefined behavior in your code.

  • Default User Avatar

    fixed

  • Default User Avatar

    done

  • Custom User Avatar

    It's asking you to return the longest string out of 2

    Where do you see this part in the description? It doesn't really exist. It's asking for a new string, so that should hint you that it's neither string a or b.

    The description isn't ideal, but it's short and to the point, and the given examples in the description should make it clear what's actually asked for.

  • Custom User Avatar

    The description is wrong compared to the solutions it's asking for. It's asking you to return the longest string out of 2 but actually it wants you to return all unique characters from BOTH strings.

  • Default User Avatar

    this is what I was trying to do with my solution, was trying to figure out how to pass a variable to inner function, which in this case is to return a function that takes a variable. Didn't think of that... thank you.