[Programmers] - 행렬의 덧셈 (Level 1)
연습문제
LEVEL : 1
문제링크
arr1 = [[1,2],[2,3]]
arr2 = [[3,4],[5,6]]
def solution(arr1, arr2):
answer = []
for i in range(len(arr1)):
tmp = []
for j in range(len(arr1[i])):
tmp.append(arr1[i][j] + arr2[i][j])
answer.append(tmp)
return answer
solution(arr1,arr2)
[[4, 6], [7, 9]]
Comments