Closed ji-0630 closed 1 year ago
def solution(n):
answer = ""
while n >= 1:
answer += str(n % 3)
if n >= 3:
n = n // 3
else:
break
return int(answer, 3)
def solution(n):
tmp = ''
while n:
tmp += str(n % 3)
n = n // 3
answer = int(tmp, 3)
return answer
문제 설명