Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
This comment is hidden because it contains spoiler information about the solution
code passed 117 tests but failed 1
__int128
is not standard, but apparently C translator decided to use it to get wider range of possible values.thanks a lot!! I just didn't think of "__int128" as a datatype....just found out about it.
I am trying to ask why do you use
unsigned long long int
, especially while solution setup quite clearly (I think) hints you that it won't be enough, and wider data type is needed.I didn't understand what you meant. could you please explain ?
Solution setup uses
__int128
, it might be worth to stick to it.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.
wouldn't it be enough to use abs() instead of fabs() ?