From 8723429700780e72597d8deb24db5bd4e5408583 Mon Sep 17 00:00:00 2001 From: yeoncheol-kim Date: Tue, 27 May 2025 08:51:40 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20Study:=20[1=EC=B0=A8]=20?= =?UTF-8?q?=EB=89=B4=EC=8A=A4=20=ED=81=B4=EB=9F=AC=EC=8A=A4=ED=84=B0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...353\237\254\354\212\244\355\204\260\353\247\201.py" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "ing-eoking/[1\354\260\250] \353\211\264\354\212\244 \355\201\264\353\237\254\354\212\244\355\204\260\353\247\201.py" diff --git "a/ing-eoking/[1\354\260\250] \353\211\264\354\212\244 \355\201\264\353\237\254\354\212\244\355\204\260\353\247\201.py" "b/ing-eoking/[1\354\260\250] \353\211\264\354\212\244 \355\201\264\353\237\254\354\212\244\355\204\260\353\247\201.py" new file mode 100644 index 0000000..71c9dcd --- /dev/null +++ "b/ing-eoking/[1\354\260\250] \353\211\264\354\212\244 \355\201\264\353\237\254\354\212\244\355\204\260\353\247\201.py" @@ -0,0 +1,10 @@ +from collections import Counter + +def solution(str1, str2): + ext = lambda s: [s[i:i+2] for i in range(len(s)-1) + if (s[i:i+2]).isalpha()] + a = Counter(ext(str1.lower())) + b = Counter(ext(str2.lower())) + itr = sum((a & b).values()) + uni = sum((a | b).values()) + return 65536 if uni == 0 else int(itr / uni * 65536)