[백준] #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))
'Programming > Algorithm' 카테고리의 다른 글
[백준] #1085 직사각형에서 탈출 python (0) | 2022.12.30 |
---|---|
[백준] #11478 서로 다른 부분 문자열의 개수 python (0) | 2022.12.30 |
[백준] #1764 듣보잡 python (0) | 2022.12.30 |
[백준] #10816 숫자 카드 2 python (0) | 2022.12.30 |
[백준] #1620 나는야 포켓몬 마스터 이다솜 python (0) | 2022.12.30 |