标签: haskell
给出列表duplicates = [[1,1,1],[2],[1,1,1]]
duplicates = [[1,1,1],[2],[1,1,1]]
如何删除重复项以使结果为[[2]]?
[[2]]
答案 0 :(得分:2)
像这样:
Data.MultiSet> [a | (a, 1) <- toOccurList (fromList [[1,1,1],[2],[1,1,1]])] [[2]]