Finding highest contiguous sum
def max_sequence(arr):
max = 0
curr = 0
for i in arr:
curr +=i
if curr < 0:
curr=0
if curr > max:
max = curr
return max
def max_sequence(arr):
max = 0
curr = 0
for i in arr:
curr +=i
if curr < 0:
curr=0
if curr > max:
max = curr
return max