Skip to content

Commit

Permalink
Merge pull request #54 from mani0921/byeongman
Browse files Browse the repository at this point in the history
[이병만] 전화번호 목록(Programmers)
  • Loading branch information
Only-bottle authored May 30, 2019
2 parents 89a7eae + 8ff6d13 commit bdd6de6
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 bdd6de6

Please sign in to comment.