-
프로그래머스 - 행렬의 덧셈 [자바]Algorithms/- 프로그래머스 2022. 3. 14. 23:08
- 문제 링크 : 행렬의 덧셈
정답(Solution)
class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int len = arr1.length; int len2 = arr1[0].length; int[][] answer = new int[len][len2]; for(int i=0; i<len; i++){ for(int j=0; j<len2; j++){ answer[i][j] = arr1[i][j] + arr2[i][j]; } } return answer; } }
분석
- 단순 이중 for문 문제
반응형