class Solution {
public int[] solution(long n) {
int[] answer;
String digit = String.valueOf(n);
StringBuffer str = new StringBuffer(digit);
String newDigit = str.reverse().toString();
System.out.println(newDigit.length());
answer = new int [newDigit.length()];
for(int i=0; i< newDigit.length(); i++){
String rev = Character.toString(newDigit.charAt(i));
answer[i] = Integer.parseInt(rev);
}
return answer;
}
}
시간 복잡도: O(n)