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. I overlooked that condition.
Because of the "if i == 0" argument, the first element is just added without checking it against anything else.
Why does this work for the first element? What is ch compared with for i=0? With the last element of the sequence iterable[-1]? Tricky! But I'm not sure if in a good way or a bad way ;)
There aren't and afaik there never were nested lists in this kata.
Just want to mention that this one fails when there is a single element list inside the list like this [['a'],'a','b'].
But I think it is very likely that the full attempt has been changed in between, because this little detail is not mentioned in the description. And probably other solutions will also fail now, but this one I was interested in ;o)
Nice one-string code
First argument in call, according to documenation is "this" for the function. That allows you to write complex constructors.