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.
Out of curiousity I benchmarked the two, this one is indeed 5 times faster.
Look at my faster solution without explicit sort. )))
Look at my faster solution without explicit sort. )))
This comment is hidden because it contains spoiler information about the solution
Without replace and regex )
This comment is hidden because it contains spoiler information about the solution
Not sure why this isn't the best answer, very easy to understand and pretty fast.
Polluting
global
withi
is not a Best Practice.The
Math.sign
call is redundant -sort
will sorta
beforeb
on-2
just as readily as on-1
.Chokes on duplicates in
ids
.OK!*JS
This comment is hidden because it contains spoiler information about the solution