비밀지도 (2018 카카오 블라인드 채용 1차)

정은경·2020년 9월 30일
0

1. 문제



2. 나의 풀이

def solution(n, arr1, arr2):
    answer = []
    # bin(0b1101 | 0b1001) 
    for i in range(len(arr1)):
        temp = str(bin(arr1[i]|arr2[i]))[2:]
        if len(temp) < len(arr1):
            temp = '0'*(len(arr1)-len(temp))+temp
        # print(temp)
        answer.append(''.join(['#' if x=='1' else ' '  for x in temp]))
    # print(answer)
    return answer

3. 남의 풀이

solution = lambda n, arr1, arr2: ([''.join(map(lambda x: '#' if x=='1' else ' ', "{0:b}".format(row).zfill(n))) for row in (a|b for a, b in zip(arr1, arr2))])


4. 느낀 점

profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글