Containing list in another list

  • Thread starter Thread starter fTob98
  • Start date Start date
F

fTob98

Guest
How to check if element from one list belongs to another list in given situation?



List<List<int>> A;

List<List<int>> B;


So I want to check if there are any elements in A that B also has. I tried following code:

A.Any(x => B.Contains(x));


but it does not work so I assume there is a mistake. The question is why this code is not working properly and what is the way to finish the task?

Continue reading...
 
Back
Top