We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b3eef2 commit 8302cf8Copy full SHA for 8302cf8
Moonjonghoo/array/matrix_multiplication.js
@@ -0,0 +1,17 @@
1
+function solution(arr1, arr2) {
2
+ const newArr = [];
3
+
4
+ for (let i = 0; i < arr1.length; i++) {
5
+ let result = [];
6
+ for (let j = 0; j < arr2[0].length; j++) {
7
+ let elem = 0;
8
+ for (let k = 0; k < arr2.length; k++) {
9
+ // arr1[0].length도 가능.
10
+ elem += arr1[i][k] * arr2[k][j];
11
+ }
12
+ result.push(elem);
13
14
+ newArr.push(result);
15
16
+ return newArr;
17
+}
0 commit comments