[BOJ]백준#1269 Silver 3 대칭차집합🔢 (Python, 파이썬)

임준성·2022년 6월 25일
0

백준 Algorithm

목록 보기
32/59
post-thumbnail

백준 1269번
https://www.acmicpc.net/problem/1269

문제



후기

⏰ 풀이시간 5분 ++⏰

기본적인 자료구조 문제다. set 자료형으로

(a-b) >> a에서 b를 없앤 차집합
(b-a) >> b에서 a를 없앤 차집합

두 차집합의 합의 길이를 더하면 정답이 출력된다.

나의 풀이

import sys
input= sys.stdin.readline

A, B = map(int,input().split())

a= set(map(int,input().split()))
b= set(map(int,input().split()))

print(len(a-b)+ len(b-a))
profile
아무띵크 있이

0개의 댓글