有一个集合字典Dictianary<int,List<int>> ,现在想把里面的每个List<int>对另一个List<int>做except运算。用foreach迭代字典,做except运算,但把结果存回原集(except运算会产生一个新集合)时提示集合迭代中错误。求解决方法!
另:
之前用HashSet<int>代替List<int>,直接用exceptWith就可以了,但HashSet建立集合的时候耗时太长,用List<int>快很多,但不支持exceptWith。