Skip to content

Instantly share code, notes, and snippets.

@yeco
Created February 23, 2010 18:59
Show Gist options
  • Select an option

  • Save yeco/312554 to your computer and use it in GitHub Desktop.

Select an option

Save yeco/312554 to your computer and use it in GitHub Desktop.
def equi(A):
l, r = 0, sum(A)
for i, e in enumerate(A):
r -= e
if l == r:
return i
l += e
return -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment