using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { var testData = new List> { new List { 1, 2, 3 }, new List { 2, 1, 3 }, new List { 6, 8, 3, 45,48 }, new List { 9, 2, 4 }, new List { 9, 2, 4, 15 } }; var testSets = testData.Select(s => new HashSet(s)); var groupedSets = testSets.GroupBy(s => s, HashSet.CreateSetComparer()); foreach(var g in groupedSets) { var setString = String.Join(", ", g.Key); Console.WriteLine($" {g.Count()} | {setString}"); } } }