코드
def solution(n):
ternary = ''
while n > 0: #3진법 수를 뒤집으며 생성
n, remainder = divmod(n, 3)
ternary += str(remainder)
return int(ternary, 3)
def solution(n):
ternary = ''
while n > 0: #3진법 수를 뒤집으며 생성
n, remainder = divmod(n, 3)
ternary += str(remainder)
return int(ternary, 3)