Skip to content

Commit

Permalink
#9 1764번 듣보잡
Browse files Browse the repository at this point in the history
  • Loading branch information
leejw-lu committed Dec 30, 2023
1 parent 3fa14c1 commit 0793beb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 문자열/1764_듣보잡.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import sys
read=sys.stdin.readline

n,m= map(int,read().split())
arr1=set() #시간복잡도 O(1)
arr2=set()
for _ in range(n):
arr1.add(read().rstrip())
for _ in range(m):
arr2.add(read().rstrip())

result=sorted(list(arr1 & arr2)) #교집합 리스트 정렬

print(len(result))
for i in result:
print(i)

0 comments on commit 0793beb

Please sign in to comment.