I can’t figure it out, trying to figure it out, but I will explain as follows,
var combinedCoords = new List<List<int>>(); var coords = new List<List<int>> { new List<int>() {0, 1}, new List<int>() {0, 1, 2}, new List<int>() {1, 3, 4, 5}, new List<int>() {3, 4}, new List<int>() {7, 8}, new List<int>() {7, 8, 9}, new List<int>() {8, 9, 10} };
Here I have a coords variable that contains several List<int> ; I need some new lists to be filled in combinedCoords , which will contain several combined lists that have common numbers. From this should be compiled 2 combined lists, the first will be {0,1,2,3,4,5} , and the second will be {7,8,9,10} . To further illustrate what I am trying to say, below is a graphical representation where each circle is a list; a red number in brackets indicates the index of each list.

(source: aboutireland.ie )