class Solution {
public String solution(String phone_number) {
String answer = "";
int range = phone_number.length() - 4;
String rep ="*";
StringBuffer sb = new StringBuffer(phone_number);
sb.replace(0,range,rep.repeat(range));
answer = sb.toString();
return answer;
}
}
StringBuffer 사용하여 문제 해결