Skip to content

Commit b7796fb

Browse files
committed
[level 1] Title: 핸드폰 번호 가리기, Time: 0.03 ms, Memory: 74.7 MB -BaekjoonHub
1 parent 0635c3c commit b7796fb

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

프로그래머스/1/12948. 핸드폰 번호 가리기/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 1] 핸드폰 번호 가리기 - 12948
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12948?language=java)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12948)
44

55
### 성능 요약
66

7-
메모리: 74.1 MB, 시간: 2.02 ms
7+
메모리: 74.7 MB, 시간: 0.03 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2026년 06월 22일 08:27:25
19+
2026년 06월 24일 09:38:14
2020

2121
### 문제 설명
2222

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
class Solution {
22
public String solution(String phone_number) {
3-
String ans = "";
4-
for (int i = 0; i < phone_number.length()-4; i++) {
5-
ans += "*";
6-
}
7-
return ans + phone_number.substring(phone_number.length()-4);
3+
StringBuilder sb = new StringBuilder();
4+
int n = phone_number.length();
5+
for (int i = 0; i < n-4; i++) sb.append('*');
6+
sb.append(phone_number.substring(n-4));
7+
return sb.toString();
88
}
99
}

0 commit comments

Comments
 (0)