public int[][] solution(int[][] arr1, int[][] arr2) {
int rows = arr1.length;
int cols = arr1[0].length;
int[][] result = new int[rows][cols];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
result[i][j] = arr1[i][j] + arr2[i][j];
}
}
return result;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/12950