Skip to content

Instantly share code, notes, and snippets.

@aerosol
Created January 27, 2011 20:29
Show Gist options
  • Select an option

  • Save aerosol/799184 to your computer and use it in GitHub Desktop.

Select an option

Save aerosol/799184 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
naur = lambda a: [(ind,i) for ind,i in enumerate(a) if sum(a[:ind+1]) == sum(a[ind:])] or -1
print naur([1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 0, -1, 1, 2, 1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment