나의 코드

import sys
input = sys.stdin.readline

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

print(len((a.difference(b)).union((b.difference(a)))))

 

풀이 방법

set 자료형

 

print(len((a - b) | (b - a)))

위와 같이 표현할 수도 있다.  

+ Recent posts