// 이진수
const makeMap = (arr,n) => {
const map = [];
for(let x of arr){
let binary = x.toString(2);
while(binary.length < n){
binary = "0" + binary;
}
let tmp = "";
for(let n of binary){
if(n == 0){
tmp += " ";
} else {
tmp += "#";
}
}
map.push(tmp);
}
return map;
}
function solution(n, arr1, arr2) {
const answer = [];
const map1 = makeMap(arr1,n);
const map2 = makeMap(arr2,n);
for(let i=0;i<n;i++){
answer[i] = ""
for(let j=0;j<n;j++){
if(map1[i][j] === "#" || map2[i][j] === "#"){
answer[i] += "#";
}
if(map1[i][j] === " " && map2[i][j] === " "){
answer[i] += " "
}
}
}
return answer;
}