配列の 2 つのリストを比較したいと思います。たとえば、次の例を見てみましょう。
List<int[]> list1 = new List<int[]>() { new int[4] { 1, 2, 3, 4 }, new int[4] { 1, 2, 3, 5 } };
List<int[]> list2 = new List<int[]>() { new int[2] { 1, 2 }, new int[2] { 3, 4 }, new int[2] { 3, 5 } };
リスト1の各要素について、リスト2のすべての要素について、それらが持つ共通要素の数を計算することを知りたいです。
元。1,2,3,4 を 1,2 と比較すると、一致する要素が 2 つになります。1,2,3,4 を 3,5 と比較すると、一致する要素が 1 つになります。
通常のリストを比較したくないので、これは重複していません。list1 の各レコードについて、list2 の項目数に共通項目がいくつ含まれているかを確認したいと考えています。