class Solution {
// Integer.bitCount : 비트로 변환했을 때 1의 갯수 반환
public int solution(int n) {
int n_num = Integer.bitCount(n);
// 주어진 숫자의 비트 형식 1의 갯수 세기
int k = n+1;
// n보다 큰 임의의 정수 K
while(true) {
int k_num = Integer.bitCount(k);
// K의 비트 형식 1의 갯수 세기
if(n_num == k_num) {
break;
// n과 k의 비트 형식 1 갯수가 같으면 반환
}
k++;
// 비트 형식 1 갯수가 다르다면 K의 크기 1 추가
}
return k;
}
}
https://shorturl.fm/gutox
https://shorturl.fm/YGMfI
https://shorturl.fm/lE5v0
https://shorturl.fm/dhmN5
https://shorturl.fm/yV6jt
Claim 5% Rebate and Exclusive Bonuses on AsterDEX https://is.gd/CGTnqR
Looking for some 25wowph action? You’ve come to the right place! Check it out here: 25wowph
Heard some buzz about the Okbet VIP Club… anyone here a member? Is it worth the climb? Thinking about joining for the perks, but want some real opinions first! okbet vip club
SV388 Thomobet… now that’s something I dabble in from time to time. If you’re into the… uh… ‘sport’, this is one place that has some action. Just saying. sv388 thomobet
Drive sales and watch your affiliate earnings soar!