superset

Fastest way to remove subsets of lists from a list in Python

Fastest way to remove subsets of lists from a list in Python Question: Suppose I have a list of lists like the one below (the actual list is much longer): fruits = [[‘apple’, ‘pear’], [‘apple’, ‘pear’, ‘banana’], [‘banana’, ‘pear’], [‘pear’, ‘pineapple’], [‘apple’, ‘pear’, ‘banana’, ‘watermelon’]] In this case, all the items in the lists [‘banana’, …

Total answers: 3