We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String numbers = {"4", "1", "2"};
package main.java.com.poogle.PG.Q12899; public class Solution { public static String solution(int n) { String[] numbers = {"4", "1", "2"}; StringBuilder answer = new StringBuilder(); while (n > 0) { int remainder = n % 3; n /= 3; if (remainder % 3 == 0) n--; answer.insert(0, numbers[remainder]); } return answer.toString(); } public static void main(String[] args) { System.out.println(solution(5)); System.out.println(solution(9)); System.out.println(solution(10)); } }
The text was updated successfully, but these errors were encountered:
78315fd
suhyunsim
No branches or pull requests
문제
핵심 아이디어
어려운 점, 실수
String numbers = {"4", "1", "2"};
3으로 나눈 나머지가 1 ,2, 0이 된다는 점에서 numbers[1], numbers[2], numbers[0] 이렇게 적용풀이
The text was updated successfully, but these errors were encountered: