class Solution {
public String binary(int num, int size){
String str = "";
while(num>0){
str = num%2 + str;
num /=2;
}
if(str.length()!=size){
while(str.length()!=size){
str = "0"+str;
}
}
return str;
}
public String[] solution(int n, int[] arr1, int[] arr2) {
String[] answer = new String[n];
for(int i=0; i<n; i++){
String str="";
String x1 = binary(arr1[i],n);
String x2 = binary(arr2[i],n);
for(int j=0; j<n; j++){
if(x1.charAt(j)=='1' || x2.charAt(j)=='1'){
str += "#";
}else{
str += " ";
}
}
answer[i] = str;
}
return answer;
}
}