Hello, programmers!
I'm experiencing the following problem - I have 2D array 2x3 named
arr, containing the letters from
a to
f as shown below:
String[,] arr = new String[2, 3]
{
{ "a", "b", "c" },
{ "d", "e", "f" }
};
My purpose is to combine all the items from the first column (a, d) with all the items from the second column (b, e) with all the items from the third column (c, f). Like this:
a b c
a b f
a e c
a e f
d b c
d b f
d e c
d e f
Is there any formula that makes my desired solution possible? I'm stuck when it comes to programming combinatorics. Thanks in advance for any help provided! :)