I am trying to use LINQto return an element that occurs with the maximum number of times AND the number of times it occurs.
For example: I have an array of strings:
string[] words = { "cherry", "apple", "blueberry", "cherry", "cherry", "blueberry" };
Some LINQ statement here
In this array, the query will return cherryas the maximum element, and 3- as the number of times when it happened. I would also like to split them into two requests, if necessary (i.e. receive the first request cherry, and the second - return the counter 3.
source
share