public int[] solution(String s) {
int[] answer = { 0, 0 };
int temp = 0;
while (s.length() > 1) {
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == '0') {
answer[1]++;
} else {
temp++;
}
}
s = Integer.toBinaryString(temp);
temp = 0;
answer[0]++;
}
return answer;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/70129