[프로그래머스] 2018 KAKAO BLIND RECRUITMENT [1차] 비밀지도 문제 풀이



1. 문제

https://programmers.co.kr/learn/courses/30/lessons/17681

2. 풀이

def solution(n, arr1, arr2):
    answer = [''] * n
    for i in range(n):
        for j in range(n):
            if bin(arr1[i])[2:].zfill(n)[j] == '1' or bin(arr2[i])[2:].zfill(n)[j] == '1':
                answer[i] += ('#')
            else:
                answer[i] += (' ')
    return answer