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.
No need to overcomplicate the task. U r given a straightforward task which presumes an array of only positive integers
I was going to use .reduce as well but this seems more efficient to me.
Not bad but I think the idea is to create Adam and Eve inside the create method
i think this more clever solution than top with spread operator.
with spread operator and reduce, we go through array twice.
I guess. I just have to read more about Set!
He creates a Set from values argument to remove dupliactes. Set return something like that 'Set(3) { 4, 7, 5 }'. Then he makes a copy of the array to convert Set into a normal array => [4,7,5].
Hope it helps u)
Is there a specific reason why you created a copy of the array in that format and not 'let arr = [...values]'.
Or is that not what line 2 is doing?