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