0

I need your assistance and advice on pairwise combination of columns (permutations) of the jagged array in C#, to be more clear let me show an example:

Input array:

String[][] arr = {
                    new String[] {"A", "B", "C"},
                    new String[] {"D", "E", "F"},
                    new String[] {"G", "H", "I"}
                   };

Output arrays should be:

String[][] F_and_S = {
"A", "B",
"D", "E",
"G", "H",
} //first column & second column

String[][] F_and_T = {
"A", "C",
"D", "F",
"G", "I",
} //first column & third column

String[][] S_and_T = {
"B", "C",
"E", "F",
"H", "I",
} //second column & third column
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
YutuKAron
  • 3
  • 1
  • What have you tried, and what exactly is the problem with it? This isn't a code-writing or tutorial service; take the [tour] and review [ask]. – jonrsharpe Aug 20 '18 at 19:26
  • I have tried doing two for loops for the columns, where I get two combinations F_and_S and S_and_T, but I can not get F_and T, that is where I stuck – YutuKAron Aug 20 '18 at 19:44
  • Then [edit] the question to provide a [mcve]. – jonrsharpe Aug 20 '18 at 19:46
  • [Quite similar, posted a few hours ago](https://stackoverflow.com/questions/51922152/operate-linq-queries-on-vertical-rather-than-horizontal-space?answertab=active#tab-top). See if it can be of use. – Jimi Aug 20 '18 at 20:57
  • Thank you very much, Jimi! :) – YutuKAron Aug 20 '18 at 21:32

0 Answers0