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.
Why someone thinks it is clever or best practice?
It is very poor
O(n^2)
complexity for problem whereO(n)
easily can be achived.Actually not as arr.slice() methods 2nd argument is not inclusive, so for each of the arr.slice(i,j) the array is sliced from index i to j-1, thats why there's no error thrown
Shouldn't it be
var j = arr.length-1