I would like to combine a few lists such that the resulting list follows the order of the original lists, which will have disjoint elements, but their order is compatible.
input = {{a,C,2},{b,C},{a,b},{b,2,z},{2}}
output = {a,b,C,2,z}
I thought of //Flatten//DeleteDuplicates//SortBy[#,orderBasedOnInput]&
without success.
Any comment would be much appreciated.
Catenate[Subsets[#, {2}] & /@ input]
$\endgroup$