
문제 풀이
파이썬 만세
startswith 함수로 바로 풀면 됩니다
def solution(phone_book):
phone_book.sort()
for i in range(len(phone_book) - 1):
if phone_book[i+1].startswith(phone_book[i]):
return False
return True반응형
'프로그래머스 - Python > 알고리즘 고득점 Kit' 카테고리의 다른 글
| 알고리즘 고득점 Kit - 완전탐색 - 모의고사 (0) | 2025.06.11 |
|---|---|
| 알고리즘 고득점 Kit - 완전탐색 - 최소직사각형 (0) | 2025.06.11 |
| 프로그래머스 알고리즘 고득점 Kit - 해시 - 폰켓몬 (0) | 2025.06.11 |
| 정렬 - K번째 수 (0) | 2025.06.11 |
| 알고리즘 고득점 Kit - 힙 - 이중우선순위큐 (0) | 2025.06.11 |