Skip to content

Commit f3647e0

Browse files
authored
Merge pull request #1674 from AlgorithmWithGod/LiiNi-coder
[20251214] PGM / LV2 / 전화번호 목록 / 이인희
2 parents 790a7e9 + 023381d commit f3647e0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```java
2+
import java.util.*;
3+
4+
class Solution {
5+
public boolean solution(String[] phone_book) {
6+
7+
Arrays.sort(phone_book);
8+
for(int i = 0; i < phone_book.length - 1; i++){
9+
String now = phone_book[i];
10+
String next = phone_book[i + 1];
11+
if(next.startsWith(now)){
12+
return false;
13+
}
14+
}
15+
return true;
16+
}
17+
}
18+
19+
```

0 commit comments

Comments
 (0)