Sunday, 8 September 2013

How Many Times a List It Is Inside Another List Using LINQ

How Many Times a List It Is Inside Another List Using LINQ

Supose I have a list of integers
List<int> l1 = new List<int> { 1, 4, 1};
I want to find out how many times another List it is inside this one.For
instance
List<int> l2 = new List<int> { 1 , 1 } occours 1 time.
List<int> l3 = new List<int> { 4, 1 } occours 1 time.
List<int> l4 = new List<int> {1} occours 2 times.
List<int> l5 = new List<int> {6,4,1} occours 0 time.
List<int> l5 = new List<int> {4,1,1} occours 1 time.
Thanks in advance

No comments:

Post a Comment