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.
clean, but the intital split/filter repetition seems a bit high in performance cost and very reduceable.
insane
20 lines? 🙂
This comment is hidden because it contains spoiler information about the solution
very nooice
Pretty clean, love it
Or you could just use a.localeCompare(b) instead of trying to find the index.Misread that.I'd say the best say is
[...'abcdefghijklmnopqrstuvwxyz']
How this test works? can you explain this?
To conclude: the best possible solution for this problem is a O(n) complexity (check my solution),
which is scaled out to O(2n) with this most "Clever"/"Best Practice".
The point is how s/he leverages pass by reference in his/her solution.
Thanks for your informative comment.
This comment is hidden because it contains spoiler information about the solution
The right hand side of the
||
is only evaluated if the left hand side is zero (a falsy value). So the sorting prioritizescount
(objects with higher count come first), and when bothcount
s are equal, the next condition is used (alphabetical sorting, bysrc
and then bychar
).@voyxxx Did you mean 'fewer'?
This solution is Bonito (Beautiful)
Loading more items...