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.
I can see why that would be a concern, however if you look at both
left
andright
, they are shortened withslice
. Sinceleft
+right
=arr
, thenleft.reduce
+right.reduce
=arr.reduce
, at least as far as the total length and amount of items reduced.Hi there!
I like the idea, but it performs
reduce
twice per each element.This is very inefficient in terms of performance. Please check my solution to see how to call
reduce
just once per the array.Regards