Skip to content

Commit 58aaf05

Browse files
jaewon1676prove-ability
authored andcommitted
Update 220425 내적.js
1 parent 0a4afac commit 58aaf05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

level-1/내적.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ function solution(a, b) {
2727

2828
return answer;
2929
}
30+
31+
//정답 4 - jaewon1676
32+
function solution(a, b) {
33+
let answer = 0;
34+
for (let i=0; i<a.length; i++){
35+
answer += (a[i] * b[i]) // a[i]와 b[i]를 곱한다.
36+
}
37+
return answer;
38+
}

0 commit comments

Comments
 (0)