public static int[][] solve(int[][] matrix1, int[][] matrix2) {
// ignore matrix1 has same size with matrix2
int[][] res = new int[matrix1.length][matrix1[0].length];
for (int i = 0; i < matrix1.length; i++) {
for (int j = 0; j < matrix1[0].length; j++) {
res[i][j] = Math.max(matrix1[i][j], matrix2[i][j]);
}
}
return res;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…