Skip to content

Commit

Permalink
Merge pull request #33 from kjs254/9-kjs254
Browse files Browse the repository at this point in the history
9-kjs254
  • Loading branch information
kjs254 authored Mar 22, 2024
2 parents b45efe9 + abfe43d commit 8e78c88
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
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

0 comments on commit 8e78c88

Please sign in to comment.