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.
Thanks for the feedback :) Do you think it worth setting the 6th level instead of 7th?
This comment is hidden because it contains spoiler information about the solution
This kata is tagged as
puzzles
. Puzzle kata are somewhat allowed to be underspecified.This comment is hidden because it contains spoiler information about the solution
See below.
Ah yes I see what you mean. That's a fairly common test case. Don't forget you can always perform some debugging by logging the input:
If you're ever not sure what's happening in a test, that can help!
Hi. The initial solution shows uses an array function, but you are free to define the function anyway you like. For exxample, all of the following declarations of
arr
are equivalent for the purposes of this kata:You can use whichever of the above styles you feel most comfortable with.
To clear up the confusion about the return, in an arrow function (or lambda), the return is just whatever follows the arrow. So in the example solution, the return is a blank array
[]
. Here are some more examples:I hope that stirs you in the right direction.