Nov-06-2021, 09:15 PM
(Nov-06-2021, 08:17 PM)CompleteNewb Wrote: I have this randomly generated list in python:
l = [[2,3,4,5],[2,3],[7,8],[2],[4,5,6]]
and i want to remove the items [2,3] and [2] because they are completely contained in the first item [2,3,4,5].
newl = [[2,3,4,5],[7,8],[4,5,6]]
How do I do that?
What about [4,3], [2,5], [6,4]. [4,2,5]?
It is looking like O(n^2); it may be worse. Knowing the actual rejection criteria is important, because that determines the complexity. It is not possible to infer the desired result from the examples given.