Last active
November 5, 2016 21:41
-
-
Save mvallebr/4ce17e5d73da155f08a4a08b007f6359 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def maxSequence(arr): | |
| max_sum = 0 | |
| current_sum = 0 | |
| for i in arr: | |
| current_sum += i | |
| current_sum = max(current_sum, i) | |
| max_sum = max(current_sum, max_sum) | |
| return max_sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment