Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def max_sequence(arr):
- if arr == []:
- return 0
- highest = []
- k = 0
- for pass_ in range(0, len(arr)):
- i = 0
- j = 2
- k += 1
- for array_pass in range(0, len(arr)):
- highest.append(sum(arr[i:j+k]))
- i += 1
- j += 1
- if max(highest)<0:
- return 0
- return max(highest)
Advertisement
Add Comment
Please, Sign In to add comment