You need to sign in or sign up before continuing.×
Ad
  • Custom User Avatar

    I'm able to pass the sample cases, but the cases tested when I click "attempt" don't pass.

    I try ending the string with the null character '\0', but when indexed at +1, it always prints one character extra.
    without the +1, it says the test cases failed.

    Before I ended with the null character it just attached an arbitrary number of characters after the original string, but that I did sort out

  • Custom User Avatar

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

  • Custom User Avatar

    code passed 117 tests but failed 1

  • Custom User Avatar

    thanks a lot!! I just didn't think of "__int128" as a datatype....just found out about it.

  • Custom User Avatar

    I didn't understand what you meant. could you please explain ?

  • Custom User Avatar

    passed 11 out of 12 tests. expects a HUGE value to be returned for a test that failed, I don't think unsigned long long int can store anything that big.

  • Custom User Avatar

    wouldn't it be enough to use abs() instead of fabs() ?