nodupes = [{i} for i in xrange(100)]
mostlydupes = [set(range(100)) - {i} for i in xrange(100)]
import timeit
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
unique_elements = {elem for elem, count in element_counts.viewitems() if count == 1}
nondupes = [original & unique_elements for original in allsets]
''', setup='import itertools; import collections; from __main__ import nodupes as allsets', number=1000)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
dupes = {elem for elem, count in element_counts.viewitems() if count > 1}
nondupes = [original - dupes for original in allsets]
''', setup='import itertools; import collections; from __main__ import nodupes as allsets', number=1000)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
unique_elements = {elem for elem, count in element_counts.viewitems() if count == 1}
nondupes = [original & unique_elements for original in allsets]
''', setup='import itertools; import collections; from __main__ import mostlydupes as allsets', number=100)
print timeit.timeit('''
element_counts = collections.Counter(itertools.chain.from_iterable(allsets))
dupes = {elem for elem, count in element_counts.viewitems() if count > 1}
nondupes = [original - dupes for original in allsets]
''', setup='import itertools; import collections; from __main__ import mostlydupes as allsets', number=100)
bm9kdXBlcyA9IFt7aX0gZm9yIGkgaW4geHJhbmdlKDEwMCldCm1vc3RseWR1cGVzID0gW3NldChyYW5nZSgxMDApKSAtIHtpfSBmb3IgaSBpbiB4cmFuZ2UoMTAwKV0KaW1wb3J0IHRpbWVpdAoKcHJpbnQgdGltZWl0LnRpbWVpdCgnJycKZWxlbWVudF9jb3VudHMgPSBjb2xsZWN0aW9ucy5Db3VudGVyKGl0ZXJ0b29scy5jaGFpbi5mcm9tX2l0ZXJhYmxlKGFsbHNldHMpKQp1bmlxdWVfZWxlbWVudHMgPSB7ZWxlbSBmb3IgZWxlbSwgY291bnQgaW4gZWxlbWVudF9jb3VudHMudmlld2l0ZW1zKCkgaWYgY291bnQgPT0gMX0Kbm9uZHVwZXMgPSBbb3JpZ2luYWwgJiB1bmlxdWVfZWxlbWVudHMgZm9yIG9yaWdpbmFsIGluIGFsbHNldHN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