function solution(s) {
let cnt=0;
let answer = s;
let zero = 0;
while(answer!=='1'){
let findZero = answer.split('0').length - 1
let editNum = answer.replaceAll("0",'');
answer = editNum.length.toString(2);
cnt++;
zero+=findZero;
}
return [cnt,zero];
}
function solution(participant, completion) {
var answer = '';
var pmap = new Map();
var cmap = new Map();
participant.map((p)=>pmap.set(p,pmap.get(p)?pmap.get(p)+1:1));
completion.map((c)=>cmap.set(c,cmap.get(c)?cmap.get(c)+1:1));
for (p of participant){
if(pmap.get(p)!==cmap.get(p)){
answer = p;
break;
}
}
return answer;
}
function solution(nums) {
var max = nums.length/2;
var ponkemon = new Map();
for(i of nums){
if(!ponkemon.has(i))
ponkemon.set(i,1);
else
ponkemon.set(i,ponkemon.get(i)+1);
}
if(ponkemon.size<max)return ponkemon.size;
else return max;
}