function solution(s) {
let answer = [0, 0];
let str = s;
let strLen = s.length;
let cnt = 0;
while (true) {
str = [...str].filter(st => st === '1').join('');
answer[0] += 1;
answer[1] += strLen - str.length;
str = (str.length).toString(2);
strLen = str.length;
if (str === '1') break;
}
return answer;
}