Skip to content

Commit 5387f87

Browse files
authored
[20251019] PGM / Lv2 / 예상 대진표 / 이강현
Implement solution for predicting matchups in a tournament.
1 parent 2260a3f commit 5387f87

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)