You are viewing a single comment's thread. Return to all comments →
of course,
prev = 0 max_val = 0 for i in range(len(vals)): prev += vals[i] vals[i] = prev if prev > max_val: max_val = prev print(max_val)
Should be faster by a constant factor.
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 →
of course,
Should be faster by a constant factor.