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.
Ugh, forgot to remove one of the
sort
s. Could have done that in one.I thought that avoiding modifying the array would be more performant, but but perf tests showed that this method is 98% slower than the top voted solutions as of time of writing. Better to just chop up the array. Way less to keep track of that way.
This comment is hidden because it contains spoiler information about the solution
Thanks @Grey, very informative writup. Now I'm looking deeper into tokenizing.
I appreciate tips on using comments better as well.
As of the time of writing, not sure why this solution has the most votes for Best Practice. It seems MUCH slower than the runner up. See this perf test for example: https://jsperf.com/parens-valid/1
If I am missing something, would appreciate learning what it is. Thanks.