I want to remove both duplicates and permutations from my nested list.
Input:
[[-1, 0, 1], [-1, 1, 0], [-1, 2, -1], [-1, 2, -1], [-1, -1, 2]]
Expected Output:
[[-1, 0, 1], [-1, 2, -1]]
I tried using a list comprehension but I end up with the output as
[[-1, 1, 0], [-1, 2, -1], [-1, 0, 1], [-1, -1, 2]]
Here is what I attempted.
a = [[-1, 0, 1], [-1, 1, 0], [-1, 2, -1], [-1, 2, -1], [-1, -1, 2]]
b_set = set(tuple(x) for x in a)
b = [ list(x) for x in b_set ]
print(b)