반응형
def solution(n, arr1, arr2):
result = []
for idx in range(n):
arr1_coordinate = bin(arr1[idx]).split("0b")[1].zfill(n)
arr2_coordinate = bin(arr2[idx]).split("0b")[1].zfill(n)
merge_coordinate = "";
for idx1 in range(n):
if arr1_coordinate[idx1] == '1' or arr2_coordinate[idx1] == '1':
merge_coordinate += '#'
else:
merge_coordinate += ' '
result.append(merge_coordinate)
return result
반응형
'삽집하는 개발들 > 알고리즘' 카테고리의 다른 글
[36일차][프로그래머스][12915]문자열 내 마음대로 정렬하기 (0) | 2023.08.01 |
---|---|
[36일차][프로그래머스][2021 카카오 채용연계형 인턴십][81301]숫자 문자열과 영단어 (0) | 2023.08.01 |
[34일차][프로그래머스][월간 코드 챌린지 시즌1][68935]3진법 뒤집기 (0) | 2023.07.30 |
[33일차][프로그래머스][147355]크기가 작은 부분 문자열 (0) | 2023.07.29 |
[33일차][프로그래머스][12926]시저 암호 (0) | 2023.07.29 |