(프로그래머스) [1차] 비밀지도

유지원·2022년 4월 11일
0

프로그래머스

목록 보기
24/66

문제 링크

https://programmers.co.kr/learn/courses/30/lessons/17681?language=javascript


Javascript

function solution(n, arr1, arr2) {
  return arr1.map((v, i) => addZero(n, (v | arr2[i]).toString(2)).replace(/1|0/g, a => +a ? '#' : ' '));
}

const addZero = (n, s) => {
  return '0'.repeat(n - s.length) + s;
}
profile
👋 https://github.com/ujw0712

0개의 댓글