Skip to content

Commit 651a1ae

Browse files
authored
Merge pull request #1643 from AlgorithmWithGod/lkhyun
[20251211] PGM / Lv2 / 다음 큰 숫자 / 이강현
2 parents c6117f0 + 6b16a5a commit 651a1ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```java
2+
class Solution {
3+
public int solution(int n) {
4+
int cur = Integer.bitCount(n);
5+
6+
while(true){
7+
n++;
8+
if(Integer.bitCount(n) == cur) return n;
9+
}
10+
}
11+
}
12+
```

0 commit comments

Comments
 (0)