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.
Description will lead you into O(nlog(n)) solution at most.
It would be helpful to have in the description info that there is a neat O(n) math solution to the problem.
that's not a proper issue report
per the description your code must handle empty vectors and return
0
in that case; but your code crashes because in the loopyou dereference an empty vector, which is undefined behavior.
Please ask
questions
to ask for help in the future, anissue
is a provable flaw in the kata ;-)CoffeeScript translation
pure fun
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Sample tests for C and NASM have a minor bug, if you get the answer wrong for the array of length 0, you crash with a SIGSEGV. (At first I thought I may have messed up seriously somewhere lol).
This seems to be because you slip into an unwanted loop here:
RISCV Translation
lmaoooooooo, just great, better yet the solution is thinking out of the box
Incorrect how.
The test cases are incorrect.
lol No spoiler code, just a little mathematics. Somehow missed this. Back to sleep.
Fun kata ty
Please tell me according to which mathematical principle this magic is obtained ? )))
Loading more items...