LINQ implementation of Cartesian Product with pruning
问题 I hope someone is able to help me with what is, at least to me, quite a tricky algorithm. The Problem I have a List ( 1 <= size <= 5 , but size unknown until run-time) of Lists ( 1 <= size <= 2 ) that I need to combine. Here is an example of what I am looking at:- ListOfLists = { {1}, {2,3}, {2,3}, {4}, {2,3} } So, there are 2 stages to what I need to do:- (1). I need to combine the inner lists in such a way that any combination has exactly ONE item from each list, that is, the possible