Skip to content

Instantly share code, notes, and snippets.

@fabian57
Last active August 29, 2015 14:16
Show Gist options
  • Save fabian57/b3a2d1a172a497d10351 to your computer and use it in GitHub Desktop.
Save fabian57/b3a2d1a172a497d10351 to your computer and use it in GitHub Desktop.
def unique_elements(l):
set_1 = set()
set_2 = set()
for i in l:
if i not in set_1:
set_1.add(i)
else:
set_2.add(i)
return set_1.difference(set_2)
@fabian57
Copy link
Author

fabian57 commented Mar 7, 2015

Merci !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment