WLJS LogoWLJS Notebook

UniqueElements

UniqueElements[{list1, list2, ...}] gives the elements for each listi that are not in any other list.

  • UniqueElements[lists, test] uses test to determine whether pairs of elements should be considered equivalent.

Examples

Find unique elements:

UniqueElements[{{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}]
(* {{1}, {}, {5}} *)

Multiple lists:

UniqueElements[{{a, b, c}, {b, c, d}}]
(* {{a}, {d}} *)

Custom equivalence:

UniqueElements[{{"A", "B"}, {"a", "c"}}, SameQ[ToLowerCase[#1], ToLowerCase[#2]] &]

Please visit the official Wolfram Language Reference for more details.

On this page