I have n number of arrays and each array may contain n number of elements. I have to generate all possible combination of values by taking one element from each array.
I need help in C#/VB.NET language.
Below is an example.
Arr1: ( a, b, c ) Arr2: ( 1, 2 ) Arr3: ( x, y, z )
I want the combinations as (There will be 3*2*3 = 18 combinations) a1x a1y a1z a2x a2y a2z b1x b1y b1z b2x b2y b2z c1x c1y c1z c2x c2y c2z
if I have 4 arrays, there will be 36 combinations. Arr1: ( a, b, c ) Arr2: ( 1, 2 ) Arr3: ( x, y, z ) Arr4: ( m, n )
Combinations:
a1xm a1xn a1ym a1yn a1zm a1zn … … … … … … … … … … … …