Skip to content

Instantly share code, notes, and snippets.

@ShinJJang
Created January 3, 2020 14:36
Show Gist options
  • Save ShinJJang/87dec3a3bc63709016dfe0ced4ee66a1 to your computer and use it in GitHub Desktop.
Save ShinJJang/87dec3a3bc63709016dfe0ced4ee66a1 to your computer and use it in GitHub Desktop.
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