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