From 8ff6d1311e777f95440f7f53bc1ad97bdc95270e Mon Sep 17 00:00:00 2001 From: leebyeongman Date: Thu, 30 May 2019 16:33:32 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=B3=91=EB=A7=8C]=20=EC=A0=84?= =?UTF-8?q?=ED=99=94=EB=B2=88=ED=98=B8=20=EB=AA=A9=EB=A1=9D(Programmers)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solutioon.py" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 "\354\235\264\353\263\221\353\247\214/Programmers/\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235/solutioon.py" diff --git "a/\354\235\264\353\263\221\353\247\214/Programmers/\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235/solutioon.py" "b/\354\235\264\353\263\221\353\247\214/Programmers/\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235/solutioon.py" new file mode 100644 index 0000000..bc06ac9 --- /dev/null +++ "b/\354\235\264\353\263\221\353\247\214/Programmers/\354\240\204\355\231\224\353\262\210\355\230\270 \353\252\251\353\241\235/solutioon.py" @@ -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