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.
This comment is hidden because it contains spoiler information about the solution
I rewrote the JavaScript tests suite, as well as enabled Node 18 + chai assertions. the test suite now includes edge cases (almost-sorted arrays, sorted arrays of length 2)
the error comes from your code, at this line:
if
array[1] == array[0]
, this divides by0
, thus raising aSIGFPE
as of now, TypeScript 4.9 is the only version available
duplicate of this issue
fixed
re-raised there as an issue
re-raised there as an issue
https://docs.codewars.com/training/troubleshooting/#c-c-signal-11---sigsegv
for some inputs, control flow can leave your function without returning any value, so your code effectively returns random memory addresses in those cases. this is visible if you add
return "???";
at the very end of your function(OP's language was Java) added fixed tests with duplicate elements
This comment is hidden because it contains spoiler information about the solution
Sometimes using built-in methods of String isn't allowed
This comment is hidden because it contains spoiler information about the solution
no need to assign 0 to num. Instance variables gets default values.
This comment is hidden because it contains spoiler information about the solution
Loading more items...