Created
January 3, 2020 14:36
-
-
Save ShinJJang/87dec3a3bc63709016dfe0ced4ee66a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(phone_book): | |
phone_book = sorted(phone_book) | |
for idx in range(len(phone_book)-1): | |
a = phone_book[idx] | |
b = phone_book[idx+1] | |
if len(a) <= len(b) and a == b[:len(a)]: | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment