Skip to content

Instantly share code, notes, and snippets.

@vikene
Created November 27, 2018 21:57
Show Gist options
  • Save vikene/7d14a790eb83dd468a80928c1e2fd8ed to your computer and use it in GitHub Desktop.
Save vikene/7d14a790eb83dd468a80928c1e2fd8ed to your computer and use it in GitHub Desktop.
Daily Coding problem #9
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