Skip to content

Commit a99f0a0

Browse files
committed
1 parent 6a25f66 commit a99f0a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Hongjoo/lv2/다음큰숫자.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
https://programmers.co.kr/learn/courses/30/lessons/12911
3+
"""
4+
def solution(n):
5+
answer= 0
6+
bin_flag= True
7+
one = list(str(bin(n))).count("1")
8+
while bin_flag :
9+
n+=1
10+
bin_flag = not(str(bin(n))[2:].count("1") == one)
11+
answer=n
12+
13+
14+
return answer

0 commit comments

Comments
 (0)