Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Python/04. Sets/014. Symmetric Difference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Enter your code here. Read input from STDIN. Print output to STDOUT
# Read input
m = int(input())
a = set(map(int, input().split()))
n = int(input())
b = set(map(int, input().split()))

# Symmetric difference
sym_diff = a.symmetric_difference(b)

# Print each element in sorted order
for num in sorted(sym_diff):
print(num)