예상대진표 | 프로그래머스

Bluewave·2024년 8월 27일

코테공부_java

목록 보기
59/99

문제

문제레벨정답률
예상대진표Lv.269%

MyCode

class Solution
{
    public int solution(int n, int a, int b)
    {
        int cnt = 0;

        while (a != b) {
            a = (a + 1) / 2;
            b = (b + 1) / 2;

            cnt++;
        }

        return cnt;
    }
}
profile
Developer's Logbook

0개의 댓글