class Solution {
public int solution(int n) {
int answer = 0;
int nowCount = Integer.bitCount(n);
while(true){
n++;
int nextCount = Integer.bitCount(n);
if(nowCount == nextCount){
break;
}
}
answer = n;
return answer;
}
}
n의 2진수 표현에서 1의 갯수를 구한 다음, n보다 큰 수 중 1의 갯수가 같은 가장 작은 수를 찾아서 반환