From 13cc86c3c620f4aee4736e18ee35079ce76cbe0f Mon Sep 17 00:00:00 2001 From: yubin Date: Mon, 5 Aug 2024 00:52:29 +0900 Subject: [PATCH] 56-xxubin04 --- xxubin04/README.md | 7 +++++ ...54\354\212\244\355\204\260\353\247\201.py" | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 "xxubin04/\352\265\254\355\230\204/\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/xxubin04/README.md b/xxubin04/README.md index 8dc097a..252a2da 100644 --- a/xxubin04/README.md +++ b/xxubin04/README.md @@ -51,3 +51,10 @@ | 47차시 | 2024.05.23 | Math | [14241]슬라임 합치기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/178 | | 48차시 | 2024.05.27 | 구현 | [125]Valid Palindrome | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/182 | | 49차시 | 2024.05.30 | Hash | [2022_KAKAO]주차 요금 계산 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/184 | +| 50차시 | 2024.06.04 | 구현 | [14]Longest Common Prefix | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/191 | +| 51차시 | 2024.07.01 | Math | [Programmers]점 찍기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/194 | +| 52차시 | 2024.07.05 | 구현 | [2019 카카오 인턴십]튜플 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/198 | +| 53차시 | 2024.07.08 | DP | [2193]이친수 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/200 | +| 54차시 | 2024.07.11 | Tree | [1991]트리 순회 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/203 | +| 55차시 | 2024.07.29 | 정렬 | [Programmers]H-Index | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/208 | +| 56차시 | 2024.08.05 | 구현 | [2018 KAKAO BLIND]뉴스 클러스터링 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/211 | \ No newline at end of file diff --git "a/xxubin04/\352\265\254\355\230\204/\353\211\264\354\212\244 \355\201\264\353\237\254\354\212\244\355\204\260\353\247\201.py" "b/xxubin04/\352\265\254\355\230\204/\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..4952a87 --- /dev/null +++ "b/xxubin04/\352\265\254\355\230\204/\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,26 @@ +from math import floor + +def solution(str1, str2): + answer = 0 + list1, list2 = [], [] + for a in range(len(str1)-1): + if (slice_a := str1[a:a+2]).isalpha(): + list1.append(str1[a:a+2].upper()) + for b in range(len(str2)-1): + if (slice_b := str2[b:b+2]).isalpha(): + list2.append(str2[b:b+2].upper()) + + total = len(list1) + len(list2) + duplication = 0 + + for i in list1: + if i in list2: + list2.remove(i) + duplication += 1 + + if len(list2) == 0 or total == duplication: + return 65536 + + answer = floor(duplication / (total - duplication) * 65536) + + return answer \ No newline at end of file