12950번 행렬의 덧셈
2023. 3. 16. 09:11ㆍProgrammers
코딩테스트 연습 - Level 1 - 행렬의 덧셈
https://programmers.co.kr/learn/courses/30/lessons/12950
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> solution(vector<vector<int>> arr1, vector<vector<int>> arr2) {
vector<vector<int>> answer;
for(int i=0;i<arr1.size();i++)
{
vector<int> temp;
for(int j=0;j<arr1[i].size();j++)
{
temp.push_back(arr1[i][j]+arr2[i][j]);
}
answer.push_back(temp);
}
return answer;
}
'Programmers' 카테고리의 다른 글
12944번 평균 구하기 (0) | 2023.03.20 |
---|---|
12947번 하샤드 수 (0) | 2023.03.16 |
12948번 핸드폰 번호 가리기 (0) | 2023.03.16 |
12954번 x만큼 간격이 있는 n개의 숫자 (0) | 2023.03.16 |
12969번 직사각형 별찍기 (0) | 2023.03.15 |