2018 Kakao Blind Recruitment - [1차] 비밀지도
2023. 3. 28. 09:20ㆍProgrammers
코딩테스트 연습 - Level 1 - [1차] 비밀지도
https://programmers.co.kr/learn/courses/30/lessons/17681
#include <string>
#include <vector>
using namespace std;
vector<string> solution(int n, vector<int> arr1, vector<int> arr2) {
vector<string> answer;
for(int i=0;i<n;i++)
{
arr1[i]=arr1[i]|arr2[i];
string str="";
for(int j=0;j<n;j++)
{
if(arr1[i]%2==0)
{
str=" "+str;
}
else
{
str="#"+str;
}
arr1[i]=arr1[i]>>1;
}
answer.push_back(str);
}
return answer;
}
'Programmers' 카테고리의 다른 글
87389번 나머지가 1이 되는 수 찾기 (0) | 2023.03.28 |
---|---|
82612번 부족한 금액 계산하기 (0) | 2023.03.28 |
12903번 가운데 글자 가져오기 (0) | 2023.03.28 |
2018 Kakao Blind Recruitment - [1차] 다트 게임 (0) | 2023.03.27 |
12906번 같은 숫자는 싫어 (0) | 2023.03.27 |