Created
November 27, 2018 21:57
-
-
Save vikene/7d14a790eb83dd468a80928c1e2fd8ed to your computer and use it in GitHub Desktop.
Daily Coding problem #9
This file contains 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 maxCount(arr): | |
prevMax = 0 | |
currMax = 0 | |
for ar in arr: | |
temp = currMax | |
currMax = max(prevMax+ar, currMax) | |
prevMax = temp | |
return currMax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment