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.
Yes, in case of all negative numbers, for example -5 to -1 as stated in your comment, the 2 maximum numbers are indeed -1 and -2. So, maximumSum would in that case be -3.
However, the 2 minimum numbers are -5 and -4, and minimumSum is then -9. Hopefully this helps :)
Yeah, that's an easy mistake to make!
FYI: this solution actually does call itself.
That's
Array.prototype.reverse
, notString.prototype.reverse
.