Last active
August 29, 2015 14:16
-
-
Save fabian57/b3a2d1a172a497d10351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Merci !