https://programmers.co.kr/learn/courses/30/lessons/68935
ํ์ด
# ํ๋ก๊ทธ๋๋จธ์ค 1๋จ๊ณ - 3์ง๋ฒ ๋ค์ง๊ธฐ
def solution(n):
answer = 0
nums = []
while n >= 1:
nums.append(n%3)
n = n//3
nums = nums[::-1]
for i in range(len(nums)):
answer += nums[i] * (3**i)
return answer