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.
nice, not sure why I didn't think of this
I don't think so.
I'm not sure of that, but probably
singleWhere
will always tranverse the whole list to ensure the condition was just met once.Given we know that only and just one number will be a outlier, using
firstWhere
is better thansingleWhere
.it does not just iterate over the whole list (in worst cases), but also duplicate it