Skip to content

Instantly share code, notes, and snippets.

@youngdo212
Created July 17, 2018 01:52
Show Gist options
  • Save youngdo212/6d9fd30890b4b4287d1b17a64f7ff3ec to your computer and use it in GitHub Desktop.
Save youngdo212/6d9fd30890b4b4287d1b17a64f7ff3ec to your computer and use it in GitHub Desktop.
카카오 알고리즘 1번 문제
function solution(n, arr1, arr2){
let result = [];
for(i = 0; i < n; i ++){
let row = (arr1[i] | arr2[i]).toString(2);
row = row.replace(/1/g, '#');
row = row.replace(/0/g, ' ');
result.push(row)
}
return result;
}
console.log(solution(5, [9,20,28,18,11], [30,1,21,17,28]))
console.log(solution(6, [46,33,33,22,31,50], [27,56,19, 14,14,10]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment