I have a such list:
data={{4, 2}, {4, 2, 3}, {4, 5}, {4, 2, 3, 5}, {4, 6}}
Because the {4,2},{4,2,3},{4,5}
is subset of {4, 2, 3, 5}
,so I want to delete they to get {{4,2,3,5},{4,6}}
.There is mess method:
DeleteCases[data, _?(Or @@
Function[list, SubsetQ[list, #]] /@ DeleteCases[data, #] &)]
{{4,2,3,5},{4,6}}
But I think must have some concise method can do this,such as by DeleteDuplicates
,Union
and other something.But I have fail to implement that.