Open jmpark0118 opened 4 years ago
import collections
if __name__ == '__main__':
n, m = map(int, input().split())
my_num = list(map(int, input().split()))
A, B = (set(map(int, input().split())) for _ in range(2))
my_num = collections.Counter(my_num)
a = [x if k in A else 0 for k, x in my_num.items()]
b = [x if k in B else 0 for k, x in my_num.items()]
print(sum(a)-sum(b))
if __name__ == '__main__':
n, m = map(int, input().split())
my_num = list(map(int, input().split()))
A, B = (set(map(int, input().split())) for _ in range(2))
plus = 0
for i in my_num:
if i in A:
plus += 1
elif i in B:
plus -= 1
print(plus)
출처 : https://www.hackerrank.com/challenges/no-idea/problem