I have a List>. How can I count all the elements in this as if it was a single List in the fastest way?
List>
List
So far I h
By using LINQ, I think your code is good with a bit changes that no need for .ToList(), just call Count() extension as the following:
.ToList()
Count()
int result = listOfLists.SelectMany(list => list).Distinct().Count();