문제
function solution(arr1, arr2, signs) {
let result = []
signs.forEach((outerElement, i) => {
let row = []
outerElement.forEach((innerElement, j) => {
if (innerElement === false) {
arr1[i][j] = arr1[i][j] * (-1)
arr2[i][j] = arr2[i][j] * (-1)
}
row.push(arr1[i][j] + arr2[i][j])
});
result.push(row)
})
return result
}
let arr1 = [[5, 7, 1], [2, 3, 5]];
let arr2 = [[5, 1, 6], [7, 5, 6]];
let signs = [[true, true, false], [false, true, false]];
console.log(solution(arr1, arr2, signs))