[프로그래머스] 행렬의 덧셈 문제 풀이

 


1. 문제

https://programmers.co.kr/learn/courses/30/lessons/12950

2. 풀이

def solution(arr1, arr2):
    row, col = len(arr1), len(arr1[0])
    answer = [ [0] * col for _ in range(row) ]
    for r in range(row):
        for c in range(col):
            answer[r][c] = arr1[r][c] + arr2[r][c]
    return answer