Skip to content

Instantly share code, notes, and snippets.

@vikene
Created November 27, 2018 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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