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.
Because it was not initialized using the 'var' or 'let' keyword.
You are right, the solution is not universal.
In many different katas we have this situation: if additional conditions described, authors do shortest solution, wich works only in particular case.
This comment is hidden because it contains spoiler information about the solution
It seems the kata currently only works when you press "Submit", not when you "Run Tests". I'm pretty sure it worked before and this is due to a change in Codewars. I'll check with the admins.
Oops, that's embarrasing. Thanks for catching that!
This solution does not handle the case where the lost number is the last one, e.g. the missing '4' in
[3,1,2]
.Note that the
acc
variable is leaked to the global scope :(This comment is hidden because it contains spoiler information about the solution
That's a terse implementation, which is nice. One notable characteristic though is that it modifies 'peopleInvited', one of the functions arguments. That would be a side-effect, which makes the 'getAttendees' function less of the functional style.