Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

행렬의 곱셈 #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

행렬의 곱셈 #114

wants to merge 1 commit into from

Conversation

say-young516
Copy link
Contributor

🔗 Related Issues

🔍 문제

프로그래머스 - 행렬의 곱셈

✅ 풀이 방법

추후 첨부

📜 최종 소스코드

function solution(arr1, arr2) {
  const answer = [];
  let tmp = 0;
  let tmpArr = [];
  for (let i = 0; i < arr1.length; i++) {
    tmp = 0;
    tmpArr = [];
    for (let j = 0; j < arr2[0].length; j++) {
      for (let k = 0; k < arr1[0].length; k++) {
        tmp += arr1[i][k] * arr2[k][j];
      }
      tmpArr.push(tmp);
      tmp = 0;
    }
    answer.push(tmpArr);
  }
  return answer;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

행렬의 곱셈
1 participant