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 like this solution because it's readable
The best explanation of filter I have found, online resources just werent making sense to me.
This comment is hidden because it contains spoiler information about the solution
Wow u make it so smol
This comment is hidden because it contains spoiler information about the solution
Super simple and clear.
This comment is hidden because it contains spoiler information about the solution
The input is a list of non-negative integers and strings only. Input validation is not required then.
I think this is the closest I've come across with one exception; it doesn't check for negative numbers.
Then again, the tests don't check for it either. This is mostly a problem with the description not matching what's tested.
Not an issue
done.
That is how the stack works, last in first out. Recursion is basically doing
node.concat(node.concat(node.concat...
, so the inner most concat or the top of the stack executes first.code golfed: function listToArray(l){return !l?[]:[l.value].concat(listToArray(l.next));}
I used recursion, but I assumed that you'd need to have a check on whethere "next" is null, but of course null is falsey, so the concat should just fail at the end. Nice, succinct.
Loading more items...