【发布时间】:2010-03-28 05:30:26
【问题描述】:
我有一个要相交的列表列表:
List<List<int>> input = new List<List<int>>();
input.Add(new List<int>() { 1, 2, 4, 5, 8 });
input.Add(new List<int>() { 3, 4, 5 });
input.Add(new List<int>() { 1, 4, 5, 6 });
输出应该是:
{ 4, 5 }
如何以简洁的方式实现这一点?
【问题讨论】:
-
您需要使用列表吗?为什么不使用哈希集?