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.
Ah, good idea - I'll give it a shot - thanks again for taking the time to respond, much appreciated :)
Hey Zruf - thanks for the resposne
Without giving too much away - How can I make this more efficient then?
I would have thought a nested for loop wouldn't be that impactful and on a similar Kata a nested for loop worked fine.
Also the code above shouldn't be printing two times? The System.Console.writeline is commented out so it only ever "returns" - not sure why it would be printing twice
This comment is hidden because it contains spoiler information about the solution
I may be misunderstanding the question - but you do know the contents of the array, as this is passed into the function you are making.
Arrays can be accessed in most languages like so - assumeing I have an array called "MyArray"
MyArray[0] - this would grab the first value of the array, MyArray[2] would grab the 3rd and so on.
You can find the length of the array in - for example C#, by using MyArray.Length
So with this in mind, you should be able to loop through an array and find the max sum
I agree with the poster above me - it would help to draw an array on a piece of paper, and figure out how you would do this manually.