Skip to content

Commit

Permalink
[이병만] 전화번호 목록(Programmers)
Browse files Browse the repository at this point in the history
  • Loading branch information
Only-bottle committed May 30, 2019
1 parent 702dfcf commit 8ff6d13
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 이병만/Programmers/전화번호 목록/solutioon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def solution(phone_book):
answer = True

phone_book.sort(key=len)
search = phone_book[0]

for match in phone_book:
# 찾는 번호가 해당 번호에 있다면 False
if match == search:
# print(match)
continue

elif search in match[0:len(search)]:
answer = False
break

return answer

0 comments on commit 8ff6d13

Please sign in to comment.