将一个交错数据合并为一个一维数组

题目: 将一个交错数据合并为一个一维数组

输入: strJaggedArray[][], 由多个一维数组(长度不定,个数不定)组成的交错数组

输出: strArray[], 由strJaggedArray[r][c]中的元素以"&"为分隔符拼合而成, 是strJaggedArray中数组元素的无重复组合(不考虑顺序)

 

举例: 

输入: strJaggedArray[0]=new string[] {"we","are","student"};

      strJaggedArray[1]=new string[] {"say","what"};

输出: strArray[]={"we&say","we&what","are&say","are&what","student&say","student&what"}

 

输入: strJaggedArray[0]=new string[] {"cs","app"};

      strJaggedArray[1]=new string[] {"good","cool","dev"};

      strJaggedArray[2]=new string[] {"king","of","the","world"};

输出: strArray[]={"cs&good&king","cs&good&of","cs&good&the","cs&good&world","cs&cool&king","cs&cool&of","cs&cool&the","cs&cool&world",...}

 

 

 

 

 

 

你可能感兴趣的:(数组)