Skip to content

Commit 9379ebb

Browse files
authored
Merge pull request #1162 from AlgorithmWithGod/lkhyun
[20251019] PGM / Lv2 / 예상 대진표 / 이강현
2 parents 3eb1cc5 + 5387f87 commit 9379ebb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```java
2+
class Solution
3+
{
4+
public int solution(int n, int a, int b)
5+
{
6+
int answer = 1;
7+
while((a/2 == b/2) || Math.abs(a-b) != 1){
8+
a = a/2 + a%2;
9+
b = b/2 + b%2;
10+
answer++;
11+
}
12+
return answer;
13+
}
14+
}
15+
```

0 commit comments

Comments
 (0)