← Back to List

20978번: 共通要素 (Common Elements) ↗

Solutions

Python 3
161 B | 161 chars
n, m = map(int, input().split())
a = set([*map(int, input().split())])
b = set([*map(int, input().split())])

for i in sorted([*a.intersection(b)]):
    print(i)