728x90
def solution(n, arr1, arr2):
answer = []
for i, j in zip(arr1, arr2):
answer.append(str(bin(i|j)[2:]).rjust(n, '0').replace('1', '#').replace('0', ' '))
return answer
def solution(n, arr1, arr2):
answer = []
a1 = []
a2 = []
for i in range(n):
t1=bin(arr1[i])[2:]
t1='0'*(n-len(t1))+t1
a1.append(t1)
t2=bin(arr2[i])[2:]
t2='0'*(n-len(t2))+t2
a2.append(t2)
for i in range(n):
temp=['#']*n
for j in range(n):
if a1[i][j]==a2[i][j]=='0':
temp[j]=' '
answer.append(''.join(temp))
return answer
728x90