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.
Take a couple elements in a row. Say, from the 2nd to the 4th, [1, -3, 4]. Sum them, and you get 2.
Find the largest such sum, and output it.
So, you have to take a part (can be all the array) which sum is the greatest. In the example, there is no way to get a value greater than 6. You can't skip values, they need to be contiguous.
I can't understand what I have to do with these numbers at all.
Test.assertEquals(maxSequence([-2, 1, -3, 4, -1, 2, 1, -5, 4]), 6)
I can see in the example that I have to start from the first 4 ([i]==3) but why would I stop at the second 1 ([i]==6) ???
What do I need after all? The sum of the numbers or the sum of the numbers between 2 specific [i]'s?
If I add the numbers I get 1.
What am I doing wrong??
Please someone make me understand this, I am thirsty for knowledge.