public class MatrixAdd {
static int[][] test1a = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};
static int[][] test1b = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};
static int[][] test2a = {{1,2,3,4,5,6,7,8},{9,10,11,12,13,14,15,16}};
static int[][] test2b = {{1,2,3,4,3,2,1,0},{5,6,7,8,9,10,11,12}};
static int[][] testcaseA = test2a;
static int[][] testcaseB = test2b;
public static void main(String args[]){
MatrixAdd inst = new MatrixAdd();
int[][] v = inst.add(testcaseA,testcaseB);
System.out.println(v);
}
// Write your code in the function below
public int[][] add(int[][] m1,int[][] m2){
int result[][];
int lb=m2.length;
result = new int[lb][lb];
for(int i = 0; i <lb; i++)
for(int j = 0; j <m2[i].length; j++)
result[i][j]=m1[i][j]+m2[i][j]; Eror is here.
return result;
}
}