const-tommy.dev
기록을 불러오는 중입니다
Math.ceil(a / 2) == Math.ceil(b / 2)// 풀이 코드를 작성하세요.
/*
1 -> 1
2 -> 1
3 -> 2
4 -> 2
N번 -> Math.ceil(N/2)
*/
function solution(n,a,b) {
let answer = 1;
while (1) {
if (Math.ceil(a / 2) == Math.ceil(b / 2)) {
break;
} else {
a = Math.ceil(a / 2);
b = Math.ceil(b / 2);
answer++;
}
}
return answer;
}