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.
Thanks for the explanation. Mathematics is the most powerful tool to simplify problems.
Thanks a lot for the explanation <3.
I see a lot of challenges are mathematical stuff. If one doesn't realize the math concept behind it, one may take a long time guessing stuff, getting nowhere, or doing a poor job with the solution.
I believe, for instance, that this very problem is related to Arithmetic Sequences and Sums.
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.Well, we all know that the answer is correct. But I believe we need some more details on how you've got it. Please check my solution for the details
Moreover, the solution uses a lot of regex
match
calls for the same array items during the sorting. That is not efficient by its nature.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