33일차

꽃봉우리·2024년 6월 3일

알고리즘 카타

My Code

class Solution {
    public int solution(int n) {
        String str = "";

        while (n != 0) {
            str += n % 3;
            n /= 3;
        }
        
        return Integer.parseInt(str, 3);
    }
}

0개의 댓글