Skip to content

Instantly share code, notes, and snippets.

@junho85
Created October 16, 2018 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junho85/32b70ae775da3feaf3a49f37ea9e4b72 to your computer and use it in GitHub Desktop.
Save junho85/32b70ae775da3feaf3a49f37ea9e4b72 to your computer and use it in GitHub Desktop.
비밀지도 javascript
function solution(n, arr1, arr2) {
var answer = [];
for (var i=0; i<n; i++) {
var result_arr = arr1[i] | arr2[i];
answer.push(result_arr.toString(2).padStart(n, '0').replace(/1/g, '#').replace(/0/g, ' '));
}
return answer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment