def solution(n):
a = bin(n).count('1')
for i in range(n+1,1000001):
if bin(i).count('1') == a:
return i
'Language > Python' 카테고리의 다른 글
[Python / 프로그래머스 level 2] 기능개발 (0) | 2021.08.13 |
---|---|
[Python / 프로그래머스 level 2] 더 맵게 (0) | 2021.08.11 |
[Python / 프로그래머스 level 2] 카펫 (0) | 2021.08.10 |
[Python / 프로그래머스 level 2] 주식가격 (0) | 2021.08.09 |
[Python / 프로그래머스 level 2] 행렬의 곱셈 (0) | 2021.08.05 |