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.
Hey jmusto,
thanks for your answer. You are right, I missed that instruction. I got it to work now :)
If you don't mind I would like to suggest you to put the instruction somewhat clearer by saying "if n is larger than values.length, simply include all values to the sum"
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 :)
Hi Chris!
Sorry it took me a while to answer - and actually sorry also for the bit misleading error message. Try this in your test suite, and see what happens:
The point you had missed is the last bullet point in the instructions:
But now that this came up, I think I'll edit the test suite a bit, to include a separate test for this.
Yeah, that's an easy mistake to make!
FYI: this solution actually does call itself.
Oh, I see! My bad, mate! :D
This comment is hidden because it contains spoiler information about the solution
That's
Array.prototype.reverse
, notString.prototype.reverse
.Was it allowed to use the very same reverse function you were prototyping?
Crazy!