Skip to content

Instantly share code, notes, and snippets.

@maxlikely
Created February 22, 2012 20:26
Show Gist options
  • Save maxlikely/1887011 to your computer and use it in GitHub Desktop.
Save maxlikely/1887011 to your computer and use it in GitHub Desktop.
Prefix Set
def ps(A):
setA = set(A)
for i,a in enumerate(A):
if a in setA: setA.remove(a)
if not setA: return i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment