[프로그래머스 lv.2] 다음 큰 숫자
2023. 9. 14. 23:48ㆍ코딩테스트
문제

나의 풀이
def solution(n):
cnt = str(bin(n)[2:]).count("1")
while(1):
n += 1
if cnt == str(bin(n)[2:]).count("1"):
break
return n'코딩테스트' 카테고리의 다른 글
| [프로그래머스 lv1.해시] 폰켓몬 (0) | 2023.09.08 |
|---|---|
| [프로그래머스 lv2.완전탐색] 소수 찾기 (0) | 2023.09.08 |
| [프로그래머스 lv1.완전탐색] 모의고사 (0) | 2023.09.07 |
| [프로그래머스 lv3] - 네트워크 (0) | 2023.09.01 |
| [프로그래머스 lv2] 타겟 넘버 (0) | 2023.09.01 |