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.
The speed of sort is irrelevant for an array of a couple of items and only a handful of invocations. Readability and maintainability is way more important for such cases.
if you use function expression for that method you have to remember about hoisting
sort is very slow. Definitely not a best practice
solution is 40% and 25% faster then two most popular solutions
This comment is hidden because it contains spoiler information about the solution
People will need to know what language you're asking about before anyone can answer that. Perhaps try posting your code as well (with markdown formatting and a spoiler tag) and you might get more targted help.
This comment is hidden because it contains spoiler information about the solution
Ddd-gx only posted that line, the complete solution requires more code, so technically, saying "works for the condition..." is wrong. Also a walk of length 5 will always be false ;)
False is a correct answer in this case. North and west aren't opposite directions. In case [ 'n', 'w', 'n', 'w', 'n', 'w', 'n', 'w', 'n', 'w' ] you will not return to the start point.
It did allow incomplete solution to pass. A walk of length, say, 5 isn't tested.
No, it doesn't.
This comment is hidden because it contains spoiler information about the solution