// Merge 2 2-dimensional arrays into one 2-dimensional array. // example input: // { 1, 2, 3; // 4, 5, 6} // { 7, 8, 9; // 10, 11, 12; // 13, 14, 15} // example output: // { 1, 2, 3; // 4, 5, 6; // 7, 8, 9; // 10, 11, 12; // 13, 14, 15}
Sigiloso
//this solution only does the loop through for the first 2-D array. Do it similarly for the second one as well. class Solution { public static void main (String[] args) { Solution interview = new Solution(); Integer[][] input1 = {{1,2,3},{4,5,6}}; Integer[][] input2 = {{7,8,9},{10,11,12},{13,14,15}}; Integer[][] result = interview.mergeArrays(input1,input2); for(int i=0;i