
[1차] 비밀지도(Lv.1)[프로그래머스 2018 KAKAO BLIND RECRUITMENT]
2022. 9. 14. 07:33
알고리즘
import java.util.*; class Solution { public List solution(int n, int[] arr1, int[] arr2) { //비밀지도1 List map1 =new ArrayList(); //비밀지도2 List map2 =new ArrayList(); //비밀지도 1+2 합친거 List secretMap = new ArrayList(); //1번지도 이진수로 변환하여 1일경우 # 0일경우 " "으로 for (int x : arr1){ String result = ""; int change = x; while (change>0){ if (change%2==1){ result+="#"; change = change /2; } else if (change%2==0) { ..