diff --git "a/4st/Eunseong/\354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.java" "b/4st/Eunseong/\354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.java" new file mode 100644 index 00000000..69001ab6 --- /dev/null +++ "b/4st/Eunseong/\354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.java" @@ -0,0 +1,16 @@ +class Solution { + public int solution(int n, int a, int b) { + int answer = 1; + while (true) { + if (Math.abs(a - b) == 1) { + if ((a > b && a % 2 == 0) || (b > a && b % 2 == 0)) { + break; + } + } + a = (int)Math.ceil((double)a / 2); + b = (int)Math.ceil((double)b / 2); + answer++; + } + return answer; + } +} \ No newline at end of file