You are viewing a single comment's thread. Return to all comments →
The final diff array should be like this:
100 100 0 0 -100 (straight foward from the code)
So when you iterate over it to get the accumalated sum you'll get this:
iteration value of x accumulated sum 0 0 0 1 100 100 2 100 200 3 0 200 4 0 200 5 -100 100
The maximum value of the accumulated sum is 200.
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
The final diff array should be like this:
100 100 0 0 -100 (straight foward from the code)
So when you iterate over it to get the accumalated sum you'll get this:
The maximum value of the accumulated sum is 200.