Skip to content

Instantly share code, notes, and snippets.

neuronsguy

Block or report user

Report or block neuronsguy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@neuronsguy
neuronsguy / gist:7439552
Created Nov 12, 2013
Solution to waterflow problem
View gist:7439552
"""
Single-pass, simple solution to waterflow problem.
"""
q = [2,5,1,3,1,2,1,7,7,6]
def solve(heights):
water = [0]*len(heights)
total = 0
runoff = 0
for i,height in enumerate(heights):
if i == 0:
You can’t perform that action at this time.