function solution(n) {
var answer = '';
let divideValue=n;
while(true){
const restValue=divideValue%3;
divideValue=Math.floor(divideValue/3);
if(restValue===0){
divideValue-=1;
answer+="4";
}
if(restValue===1){
answer+="1"
}
if(restValue===2){
answer+="2"
}
if(divideValue<1)
break;
}
return answer.split("").reverse().join("");
}
1 1 => 0 1
2 2 => 0 2
3 4 -> 1 0
4 11 => 1 1
5 12 => 1 2
6 14 => 2 0
7 21 = > 2 1
8 22 => 2 2
9 24 => 3 0
10 41 => 3 1
11 42 => 3 2
12 44 => 4 0 <0일 경우 몫에서 1을 뺌 > 3 0 3은 4
13 111 =>
14 112=>
15 114=>