컴공생의 다이어리
[프로그래머스] 비밀지도 - 파이썬(Python) 본문
[프로그래머스] 비밀지도 - 파이썬(Python)
def solution(n, arr1, arr2):
answer = []
for i, j in zip(arr1, arr2):
temp = str(bin(i | j)[2:]).rjust(n, '0')
temp = temp.replace('1', '#')
temp = temp.replace('0', ' ')
answer.append(temp)
return answer
https://programmers.co.kr/learn/courses/30/lessons/17681
코딩테스트 연습 - [1차] 비밀지도
비밀지도 네오는 평소 프로도가 비상금을 숨겨놓는 장소를 알려줄 비밀지도를 손에 넣었다. 그런데 이 비밀지도는 숫자로 암호화되어 있어 위치를 확인하기 위해서는 암호를 해독해야 한다. 다
programmers.co.kr
728x90
'Development > Algorithm & Coding Test' 카테고리의 다른 글
[프로그래머스] 입국심사 - 파이썬(Python) (0) | 2022.06.26 |
---|---|
[프로그래머스] 영어 끝말잇기 - 파이썬(Python) (0) | 2022.06.25 |
[프로그래머스] N으로 표현 - 파이썬(Python) (0) | 2022.06.21 |
[프로그래머스] 순위 - 파이썬(Python) (0) | 2022.06.20 |
[프로그래머스] 가장 먼 노드 - 파이썬(Python) (0) | 2022.06.19 |
Comments