Skip to content

Instantly share code, notes, and snippets.

@folz
Created March 30, 2011 03:02
Show Gist options
  • Save folz/893783 to your computer and use it in GitHub Desktop.
Save folz/893783 to your computer and use it in GitHub Desktop.
takes a string and returns that string with all duplicate letters stripped out
def unique(s):
'''
@param s:
a string
takes a string and returns that string with all duplicate
letters stripped out
'''
i=0
y={}
for c in s:
y[c]=i
return ''.join(c for c in y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment