https://programmers.co.kr/learn/courses/30/lessons/12949
function solution(arr1, arr2) {
var answer = [];
arr1.forEach(row => answer.push(Array(arr2[0].length).fill(0)));
for(let i = 0; i < arr1.length; i++) {
for(let j = 0; j < arr2[0].length; j++) {
for(let k = 0; k < arr2.length; k++) {
answer[i][j] += arr1[i][k] * arr2[k][j];
}
}
}
return answer;
}
인덱스 설정 너무 헷갈려요...😵
//다른 분들의 풀이
function solution(arr1, arr2) {
return arr1.map((row) => arr2[0].map((x,y) => row.reduce((a,b,c) => a + b * arr2[c][y], 0)))
}
ㅗㅜㅑ,,,, 녜?