Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9-kjs254 #33

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kjs254/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
| 5μ°¨μ‹œ | 2024.02.24 | DFS | [λͺ¨μŒμ‚¬μ „](https://school.programmers.co.kr/learn/courses/30/lessons/84512) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/19) |
| 6μ°¨μ‹œ | 2024.02.27 | μŠ€νƒ | [κ΄„ν˜Έ νšŒμ „ν•˜κΈ°](https://school.programmers.co.kr/learn/courses/30/lessons/76502) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/22) |
| 7μ°¨μ‹œ | 2024.03.01 | κ΅¬ν˜„ | [μΊμ‹œ](https://school.programmers.co.kr/learn/courses/30/lessons/17680) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/24) |
| 8μ°¨μ‹œ | 2024.03.08 | κ΅¬ν˜„ | [νŠœν”Œ](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/30) |
| 8μ°¨μ‹œ | 2024.03.08 | κ΅¬ν˜„ | [νŠœν”Œ](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/30) |
| 9μ°¨μ‹œ | 2024.03.10 | κ΅¬ν˜„ | [λ‰΄μŠ€ ν΄λŸ¬μŠ€ν„°λ§](https://school.programmers.co.kr/learn/courses/30/lessons/17677) | [#33](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/33) |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
def MakeSet(s): #2κΈ€μžμ”© λŠμ€ μ•ŒνŒŒλ²³λ§Œ 리슀트둜 좜λ ₯
lst = []
for i,_ in enumerate(s[:-1]):
a = s[i:i+2]
if a.isalpha():
lst.append(a.lower())
return lst

def func(l1, l2): #쀑볡 ꡐ집합과 쀑볡 ν•©μ§‘ν•©μ˜ 길이λ₯Ό 각각 좜λ ₯
intersection_set, union_set = [], []
inter = set(l1) & set(l2)
union = set(l1) | set(l2)

for n in union:
intersection_num = min(l1.count(n),l2.count(n))
union_num = max(l1.count(n),l2.count(n))

for _ in range(intersection_num):
intersection_set.append(n)

for _ in range(union_num):
union_set.append(n)

return len(intersection_set), len(union_set)

def solution(str1, str2): #메인 μ½”λ“œ
answer = 0

arr1 = MakeSet(str1)
arr2 = MakeSet(str2)

a,b = func(arr1,arr2)

if b:
answer = int((a/b)*65536)
else:
answer = 65536

return answer