Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
To find the water puddle problem to http://qandwhat.runkite.com/i-failed-a-twitter-interview/
def findMax(A):
maxW=0
startValue=A[0]
count=0
for count,i in enumerate(A):
if count==0 or i==A[-1]:
startValue=i
continue
if i<startValue:
maxW=maxW+(startValue-i)
else:
startValue=i
return maxW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.