the code is attached. I've gone over it a few times, but I can't figure out exactly what it is doing. The way I solved it was to iterate over the list n times, each time summing that element, then that and the next, then the next and so on until you find the occurence with the largest sum...
but this one does it by just passing over the array once, how does that work? I know the meat is in the for-loop but I don't see how this works to find the largest sum! how does this work?
thanks!
-SelArom
but this one does it by just passing over the array once, how does that work? I know the meat is in the for-loop but I don't see how this works to find the largest sum! how does this work?
thanks!
-SelArom
