Guest User

Untitled

a guest
Jan 31st, 2023
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def max_sequence(arr):
  2. if arr == []:
  3. return 0
  4. highest = []
  5. k = 0
  6. for pass_ in range(0, len(arr)):
  7. i = 0
  8. j = 2
  9. k += 1
  10. for array_pass in range(0, len(arr)):
  11. highest.append(sum(arr[i:j+k]))
  12. i += 1
  13. j += 1
  14. if max(highest)<0:
  15. return 0
  16. return max(highest)
Advertisement
Add Comment
Please, Sign In to add comment