# 이진 변환 함수
def binary_trans(s):
origin = len(s)
s = s.replace('0','')
remove_zero = origin - len(s)
binary = format(len(s),'b')
return str(binary),remove_zero
def solution(s):
count = 0
zero_count = 0
# new_s = 이진 변환 함수(s)
while s != '1':
s,remove_zero = binary_trans(s)
count += 1
zero_count += remove_zero
return [count,zero_count]
def solution(s):
a, b = 0, 0
while s != '1':
a += 1
num = s.count('1')
b += len(s) - num
s = bin(num)[2:]
return [a, b]