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.
Algorithim is not fast enough under larger numbers.. Increase the speed and it should help
Just for testing. It's not required
In English, Y is almost always a vowel, in fact, rarely is it used as a consonant. This was quite a surprise when I made this discovery...
I hope your day
10 months ago
was good and I hope this turns out to also be a good day for you and everyone else.in English, Y is usually a vowel anyway, like the three out of four times you see it in this comment
Yes.
just Y ? :((
Thank you for that expanation. It wasn't clear for me from description what really needed to be done.
@benjaminzwhite I would like to clarify if I understood the task correct. one of the tests consist the folow array [7,4,11,-11,39,36,10,-6,37,-10,-32,44,-26,-34,43,43] and the correct answer is 155, but my code can find another the highest value. Just look, please, [4,11,39,36,-6,37,44,-26,43,43] === 225. This is the maximum possible value. It is the reason why I ask, if I understood the task correct? Thank you!
Thank you so much for writing that! Saved me a lot of confusion!
Thank you. I couldn't understand the instruction. After reading your post, i got the idea. Thanks.
thank you so much! I've been stuck on this for ages.
Hi @Kippe and welcome to Codewars!
You are allowed to pick a contiguous subarray of any length not just length = 4.
So in the array you are asking about it turns out that the answer is the entire array sums up to 155 which is the maximum possible.
Meanwhile, in the array
[-1,-1,-2,100,230,-5,-7]
the answer would be the subarray[100,230]
which produces a sum of330
which is the maximum possible, as for example including[-2,100,230,-5]
would be less than330
etc.Hi,
i thought i understand, but how can
([7, 4, 11, -11, 39, 36, 10, -6, 37, -10, -32, 44, -26, -34, 43, 43]), 155)
sum up to 155? I dont see a substring of length 4 in this that could return 155.
To anyone who doesn't understand the assignment: You have an array e.g [-2, 1, -3, 4, -1, 2, 1, -5, 4] You now have to find out which part of this array gives the biggest sum. In this case, it would be [4, -1, 2, 1] because 4 - 1 + 2 + 1 = 6. No other uninterrupted sequence in that array gives you a bigger sum.