I have an List<Array>, I'm using LINQ to find duplicates and count, but it's not work.
See the image you can see, lstMyList[0] and lstMyList[11] have the same value in Int[]
Here is lstMyList definition:
List<Array> lstMyList = new List<Array>();
I used code, but it's not work:
var group = lstMyList.GroupBy(t => t).ToArray();
or
Dictionary<int[], int> count = lstMyList.GroupBy(x => x).ToDictionary(g => g.Key, g => g.Count());
Here is image: http://imageshack.com/a/img69/2552/h114.png
Maybe somebody can give me a hint about my problem.
lstMyListclass definition?int[]is probably not going to work for you. We need the class definition.int[] { 1, 2 }- they are not equal to each other using standard equality as arrays are reference types and they only compare if the array is the same reference. Two arrays, even with the same values, are different.