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.
in
.reduce((a,c)=> ... ? c : a)
thea
is our current best choice. Thec
is the next one we are checking. We make a comparison (in...
) and ifc
is a better choice, we return that, otherwise we returna
. Whichever one we return, will becomea
in the next comparison. When there is nothing left to compare,a
is returned (the best choice from all).https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in
If
v in seen
thenfalse
and that means, filter thev
from the array.When reporting a problem, please state the language you're talking about, not all languages have the same tests.