Consider the following:
list={{a,b,c},{c,d,e},{d,e,f},...{x_,y_,z_}};
I would like to apply Union
on the elements of the list in the following way
Union[{a,b,c},{c,d,e},{d,e,f},...{x_,y_,z_}];
The problem Union[list]
does not return the desired result when applied on list
. Please consider the following example:
list={{10,2,3},{2,3,4},{2,3,50}};
Union[list]
The same problem occures with Intersection
.
(* Out={{10,2,3},{2,3,4},{2,3,50}} *)
Instead of
Union[{10,2,3},{2,3,4},{2,3,50}]
(* Out={2,3,4,10,50} *)
Apply
? $\endgroup$Union@Flatten@list
$\endgroup$Apply
works. Many thanks $\endgroup$