작성
·
203
0
public class Main{
public String solution(int num, String str) {
String answer = "";
for (int i=0; i<num; i++ ) {
String tmp = str.substring(0, 7).replace('#', '1').replace('*', '0');
answer += Character.toString(Integer.valueOf(tmp, 2));
str = str.substring(7);
}
return answer;
}
public static void main(String[] args) {
Main T = new Main();
Scanner scr = new Scanner(System.in);
int num = scr.nextInt();
String str = scr.next();
System.out.println(T.solution(num, str));
}
}