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.
You use length to index, that is how I did it since I figured it would be faster than back
This comment is hidden because it contains spoiler information about the solution
Yeah... Seems you cannot use recursive function this way cause it is detected as a cheat. Sounds weird.
This comment is hidden because it contains spoiler information about the solution
I know it's a while now, but for whoever is also wondering:
I believe it's just a matter of preference using
const
arrow-functions for one-liners andfunction
for longer functions.This comment is hidden because it contains spoiler information about the solution
Nope, not happening
As far as I understand, there's only one acceptable solution and it doesn't actually work for all arrays. I'd prefer for the length requirement to be a bit longer and encourage a more robust solution.
The count includes the function name and you can typically save a char omitting the semicolon from the end
My attempt went through, but the sample tests appeared to be broken for me:
Error: Please pass numbers as strings or BigNumber objects to avoid precision errors.
at Object.toWei
at runTransaction
at /home/codewarrior/index.js:64:1
at /home/codewarrior/index.js:40:4
at Object.handleError
(anonymous function) [as .js]
I refactored this, but Codewars doesn't let you delete solutions unfortunately. I think there could be a cyclical test that this would fail by returning due to a duplicate process instead of ignoring it and moving on.
Thanks, added
Missing Solidity example in the description.
Solidity translation added.
This kata is much easier to understand if you reference the Linked List document mentioned, but I think more should be added to the description. "The push function accepts head and data parameters, where head is either a node object or null/None/nil. Your push implementation should be able to create a new linked list/node when head is null/None/nil." At the very least, I would suggest specifying that the expected return of the push function is the head of the new / modified Linked List. Lots of implementations of Linked Lists are object-oriented with functions performing side effects, so this isn't necessarily obvious.
Loading more items...