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.
A quick glance at this gives me the impression it is not efficient in time or memory usage.
Yes there is an issue with the test cases.
They should add a test case like the one you lay out here.
Your solution is easy to read and contains functions that I did not know about previously. I learned some Javascript from it.
I should go through it one more time to pick up a couple more new things I didn't know before.