how to count duplicates in LINQ code example
Example: 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();