I have a nested list, as in the example:
List<List<int>> myList = new List<List<int>>();
myList.Add(new List<int> { 2, 7, 3 });
myList.Add(new List<int> { 4, 6});
myList.Add(new List<int> { 2, 5, 1 });
myList.Add(new List<int> { 7, 0, 2 });
myList.Add(new List<int> { 4, 9 });
I want to combine all lists that have at least one element, so that the output will be List<List<int>>with the elements:
List<int> 2, 7, 3, 5, 1, 0
List<int> 4,6,9
thank
source
share