Answers for "find duplicates in lists with LINQ and get count"

0

find duplicates in lists with LINQ and get count

var query = lst.GroupBy(x => x)
              .Where(g => g.Count() > 1)
              .Select(y => new { Element = y.Key, Counter = y.Count() })
              .ToList();
Posted by: Guest on April-20-2021

Code answers related to "find duplicates in lists with LINQ and get count"

Browse Popular Code Answers by Language