Skip to content

Commit 7de410f

Browse files
authored
Update 행렬의-덧셈.js
1 parent 8bc50ee commit 7de410f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

level-1/행렬의-덧셈.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,16 @@ function solution(arr1, arr2) {
3535
}
3636
return answer;
3737
}
38+
39+
//정답 4 - yongchanson
40+
function solution(A, B) {
41+
let answer = [];
42+
43+
for (let i = 0; i < A.length; i++) {
44+
answer[i] = [];
45+
for (let j = 0; j < A[0].length; j++) {
46+
answer[i][j] = A[i][j] + B[i][j];
47+
}
48+
}
49+
return answer;
50+
}

0 commit comments

Comments
 (0)