def solution(phone_book):
hash_set = set(phone_book)
for phone_number in phone_book:
prefix = ""
for digit in phone_number[:-1]:
prefix += digit
if prefix in hash_set:
return False
return True'PS' 카테고리의 다른 글
| 프로그래머스 43162 Python [네트워크, DFS] (0) | 2026.08.27 |
|---|---|
| 프로그래머스 12978 Python [배달, 다익스트라 알고리즘] (0) | 2026.08.27 |
| 프로그래머스 12981 Python [영어 끝말잇기] (0) | 2026.08.26 |
| 프로그래머스 1844 Python [게임 맵 최단거리] (0) | 2026.08.13 |
| 프로그래머스 42748 Python [K번째수] (0) | 2026.08.13 |