[Programmers] 3진법 뒤집기
Python
def solution(n):
answer = ''
while n > 0:
n, remainder = divmod(n,3)
answer += str(remainder)
return int(answer, 3)
def solution(n):
answer = ''
while n > 0:
n, remainder = divmod(n,3)
answer += str(remainder)
return int(answer, 3)
댓글남기기