Skip to content

Commit b8611f2

Browse files
committed
행렬의 덧셈 /중급
1 parent 082d0b9 commit b8611f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function solution(arr1, arr2) {
2+
let answer = [];
3+
for (let i = 0; i < arr1.length; i++) {
4+
let newArr = [];
5+
for (let j = 0; j < arr1[0].length; j++) {
6+
newArr.push(arr1[i][j] + arr2[i][j]);
7+
}
8+
answer.push(newArr);
9+
}
10+
11+
return answer;
12+
}

0 commit comments

Comments
 (0)