How to find the total redundancy in the numerical list

If I have a list

List<int> mylist = new List<int>();
mylist.Add(15);
mylist.Add(15);
mylist.Add(10);
mylist.Add(10);
mylist.Add(10);

If you want Count() which is equal to "10" Give me the number 3

Jon Skeet
people
quotationmark

It sounds like you probably just want to use LINQ:

int target = 10; // Or whatever
int count = myList.Count(x => x == target);

people

See more on this question at Stackoverflow