[백준] #1269 대칭 차집합 python

2022. 12. 30. 17:35

https://www.acmicpc.net/problem/1269

 

1269번: 대칭 차집합

첫째 줄에 집합 A의 원소의 개수와 집합 B의 원소의 개수가 빈 칸을 사이에 두고 주어진다. 둘째 줄에는 집합 A의 모든 원소가, 셋째 줄에는 집합 B의 모든 원소가 빈 칸을 사이에 두고 각각 주어

www.acmicpc.net

📕 설명 📕

집합 A, B의 차집합을 각각 뺀 길이를 더한다.

🧑🏻‍💻 나의 풀이 🧑🏻‍💻

A, B =map(int ,input().split())
A_set = set(map(int, input().split()))
B_set = set(map(int, input().split()))
print(len(A_set- B_set) + len(B_set - A_set))

 

BELATED ARTICLES

more