I have an array of numbers, I'm trying to see the value of the numbers that occur 3 times in the array. For example here is an array of numbers [4, 4, 4, 3, 3] and when I pass this into this query as dice:
var triples = dice.GroupBy(x => x).Where(g => g.Count() > 2).Select(y => y.Key);
I can see in the results view of the triples object a 4
which is what I want but how do I pull that number out and into a variable to use? I don't understand LINQ that well yet. Thanks!
Right now I get object of type: System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Linq.IGrouping<int,int>,int>
as the value of triples, and when I dive into the object I can see the value that I want "4" in the results view