Question: Suppose I have the list [[1,2,3],[4,5,6],[3,2,1]], the first and last element (which are also lists) of the list are actually the same - they contain the same set of numbers, just with different order. If I want to create a function that takes in a list of list, and remove those duplicate list elements (in this case, remove either [1,2,3] or [3,2,1] and keep the remaining one), how do I do that?

thank you

Answer: 
Convert each and every element of the list to a set and then to a tuple and form a new set to get the result you expect.

```
data = [[1,2,3],[4,5,6],[3,2,1]]
print(set(tuple(set(item)) for item in data))
# {(4, 5, 6), (1, 2, 3)}

```

We can use `frozenset` here, like this

```
print(set(frozenset(item) for item in data))
# {frozenset({1, 2, 3}), frozenset({4, 5, 6})}

```
Another way of doing it is using map:

```
map(list, set(map(frozenset, lst)))

```

This will give you [[1, 2, 3], [4, 5, 6]]

What it basically does, is it applies frozenset to the lst. We use frozenset because set only stores immutable items. 
Doing map(frozenset, lst), gives us:
 [frozenset([1, 2, 3]), frozenset([4, 5, 6]), frozenset([1, 2, 3])]
From that, apply set and we get:
 set([frozenset([1, 2, 3]), frozenset([4, 5, 6])])

and mapping list to this gives us [[1, 2, 3], [4, 5, 6]]