Ad
  • Default 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

  • Default User Avatar

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

  • Default User Avatar

    code passed 117 tests but failed 1

  • Default User Avatar

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

  • Default User Avatar

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

  • Default 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.

  • Default User Avatar

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