나의 풀이
def solution(n):
cur = bin(n)[2:].count('1')
while True:
n += 1
if cur == bin(n)[2:].count('1'):
break
return n
'코딩 테스트 (Coding Test)' 카테고리의 다른 글
[프로그램스] 영어 끝말잇기 (0) | 2023.01.17 |
---|---|
[프로그래머스] 짝지어 제거하기 (0) | 2023.01.17 |
[프로그래머스] 피보나치 수 (0) | 2023.01.16 |
[프로그래머스] 숫자의 표현 (0) | 2023.01.16 |
[프로그래머스] 이진 변환 반복하기 (0) | 2023.01.16 |