I have list of lists. For example:
List<List<string>> bigList = new List<List<string>>();
var l1 = new List<string>();
l1.Add("a1");
l1.Add("a2");
l1.Add("a3");
var l2 = new List<string>();
l2.Add("b1");
l2.Add("b2");
var l3 = new List<string>();
l3.Add("c1");
l3.Add("c2");
bigList.Add(l1);
bigList.Add(l2);
bigList.Add(l3);
I need to create new list of lists, that will have 12 elements in my example (3*2*2). I need all combinations.
Result should be like this:
//a1,b1,c1
//a1,b1,c2
//a1,b2,c1
//a1,b2,c2
//a2,b1,c1
//a2,b1,c2
//a2,b2,c1
//a2,b2,c2
//a3,b1,c1
//a3,b1,c2
//a3,b2,c1
//a3,b2,c2
Off course should work for any list of lists. Not just for this example. I realy have problem to write this algorithm. Thanks for help.