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.
Because there's no need to reinvent the wheel.
fixed in C
Fixed the warning.
Exit code 132
is due to Swift crashing with*** Program crashed: Illegal instruction at 0x000055cd112cc93c ***
. "Illegal instruction" in Swift are caused by failed preconditions, such as integer overflow or out-of-bounds accesses.This one is caused by integer overflow in your
while (c != 0)
loop. You reverse the digits ofc
intom
by successive multiplications ofm
by10
and adding the last digit ofc
. This fails whenc
has as many digits asInt.max
and ends with large digits, the last multiplication by10
overflows.I added better assertion messages to Swift.
All languages except COBOL and pending translations are now identical: no rounding, integer inputs. I will review pending translations, update, and approve them too. I will try to bring COBOL to the common form too, but I'll see how it goes :)
I will close this issue and raise a new one for COBOL if I won't be able to get it to work.
Python fork adding random tests.
Haskell fork that fixes the random tests so that failed tests show the input strings along with some other minor improvements to test generation.
Author changed the link, close the issue
out
is a local array variable. withreturn out;
you are returning the address of a local variable, which is incorrect. as soon as the function exits the address becomes invalid.out
is missing1
byte for the nul-terminatorIf you push code like this to prod you're getting fired lmao, shorter != better
fork approved
Function name typo
Function names misspelled in both.
Fixed, now all tests are guaranteed to have uppercase
the funniest thing is that the only lowercase test; all random tests are using uppercase
Loading more items...