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.
It does say "ends" there, so it's always the trailing part.
More information should be given in instruction. Such as when the number is split by characters, do we increment the heading or the trailing part?
Sorting given array seems like a wasted effort in this case, especially when you consider that it's not even properly sorted. That would still get the job done, but it's an expensive solution.
you probably forget arr.length - 1 instead of arr.length