# Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table?

For example in $A$ I want to erase one of $\{a,b\},\{b,a\}$, and $\{a,b,c,d,e\},\{e,d,c,a,b\}$. Which could be the shortest way to do that? I don't mind which is the erased element...

• DeleteDuplicates[list, Sort@#1 == Sort@#2 &] - and don't use uppercase initials for your own symbols (like A)... – ciao Apr 10 '15 at 3:29
• DeleteDuplicates[Sort/@A] looks like it would be faster, if you don't mind the sub lists being sorted afterwards. – Sjoerd C. de Vries Apr 10 '15 at 5:48
• Proposed duplicate: (44). Related: (1302), (5799), (17041) – Mr.Wizard Apr 10 '15 at 6:09

Perhaps something as simple as

data = {{a, b}, {b, a}, {a, b, c, d, e}, {e, d, c, a, b}};
Union[Sort /@ data]

{{a, b}, {a, b, c, d, e}}

• Keep it small and simple... +1! – mgamer Apr 10 '15 at 5:38

Or this:

lst = {{a, b}, {b, a}, {a, b, c, d, e}, {e, d, c, a, b}};
DeleteDuplicates[Sort/@lst]
(* {{a, b}, {a, b, c, d, e}} *)