Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def unique(lst):
- ones = 0
- twos = 0
- for x in lst:
- twos |= ones & x
- ones ^= x
- not_threes = ~(ones & twos)
- ones &= not_threes
- twos &= not_threes
- return ones
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement