From 61dd4cdd116619f7f609f743e34afbbfb559d1f1 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Chauhan <143814425+Rsc2414@users.noreply.github.com> Date: Fri, 18 Jul 2025 20:54:45 +0530 Subject: [PATCH] Create 014. Symmetric Difference.py --- Python/04. Sets/014. Symmetric Difference.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Python/04. Sets/014. Symmetric Difference.py diff --git a/Python/04. Sets/014. Symmetric Difference.py b/Python/04. Sets/014. Symmetric Difference.py new file mode 100644 index 0000000..5703ba9 --- /dev/null +++ b/Python/04. Sets/014. Symmetric Difference.py @@ -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)