我想获取a Dictionary<string, List<int>>然后为字典中的所有重复列表创建组.
Dictionary<string, List<int>> AllLists = new Dictionary<string, List<int>>()
{
{"one", new List<int>() {1, 2, 3, 4, 5}},
{"two", new List<int>() {1, 2, 3, 4, 5}},
{"three", new List<int>() {1, 1, 1, 1, 1}}
};
var ListGroups = AllLists.GroupBy(p => p.Value);
Run Code Online (Sandbox Code Playgroud)
这应该将带有匹配列表的字典索引分组到它们自己的组中,但它只是为字典中的每个索引创建一个组.我究竟做错了什么?