# Discarding lists of same elements

Suppose, I have a list of lists where multiple lists can have same elements. In my final output, I just want one list with the same element. An example is the following:

Input: A=[[1,2,0], [0,1,2], [2,1,0], [4,5,6], [6,5,4]]

Desired Output: $$[[0,1,2], [4,5,6]]$$

Can someone help me with an easy function for doing so? Thank you so much.

• What about [[1, 2], [2, 3]]? Commented Mar 1, 2023 at 6:22
• Your question is not clear. Please specify exactly what you want the output to be in general. One example is not a substitute for a general problem specification. "one list with the same element" is not clear. Same as what? You mention only one element, but the example shows multiple elements.
– D.W.
Commented Mar 1, 2023 at 18:17
• In fact, you are seeing your lists as (multi)sets.
– user16034
Commented Jul 29, 2023 at 11:43

$$[[1,2,0], [6,5,4], [0,1,2], [2,1,0], [4,5,6]]$$ then $$[[0,1,2], [4,5,6], [0,1,2], [0,1,2], [4,5,6]]$$ then $$[[0,1,2], [0,1,2], [0,1,2], [4,5,6], [4,5,6]]$$