Skip to content

Commit 00977d6

Browse files
authored
[20251215] PGM / Lv2 / 예상 대진표 / 이종환
1 parent 318f43c commit 00977d6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```java
2+
import java.io.*;
3+
import java.util.*;
4+
5+
class Solution
6+
{
7+
public int solution(int n, int a, int b)
8+
{
9+
int answer = 0;
10+
a--;
11+
b--;
12+
while (a != b){
13+
answer++;
14+
a /= 2;
15+
b /= 2;
16+
}
17+
18+
return answer;
19+
}
20+
}
21+
```

0 commit comments

Comments
 (0)