def solution(n, arr1, arr2):
answer=[]
for i in range(n):
board=""
tmp1=list(str(bin(arr1[i])))
tmp1[1]='0'
tmp1=["0"]*n+tmp1
tmp1=tmp1[-n:]
tmp2=list(str(bin(arr2[i])))
tmp2[1]='0'
tmp2=["0"]*n+tmp2
tmp2=tmp2[-n:]
for j in range(n):
if tmp1[j]=="1" or tmp2[j]=="1":
board+="#"
else: board+=" "
answer.append(board)
return answer
'자기개발👨💻 > 코딩 알고리즘' 카테고리의 다른 글
[python] 백준 10814 나이순 정렬 (0) | 2021.01.31 |
---|---|
[python] 프로그래머스 카펫 (0) | 2021.01.07 |
[python] 프로그래머스 모의고사 (0) | 2021.01.07 |
[python] 문자열 다루기 기본 (예외처리로 해결) (0) | 2021.01.03 |
[python] 2016년 (요일구하기) (0) | 2021.01.03 |
같은 숫자는 싫어 (틀린코드/맞는코드) (1) | 2021.01.03 |