We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Symmetric Difference
- Discussions
Symmetric Difference
Symmetric Difference
Sort by
recency
|
1237 Discussions
|
Please Login in order to post a comment
print(*(lambda m, set_m, n, set_n : sorted(set_m.symmetric_difference(set_n)))(input(), set(map(int, input().split())), input(), set(map(int, input().split()))), sep="\n")
Great way to get hands-on practice with Python sets and understand their practical use. Looking forward to more challenges like this! Cricbet99 login id and password
M, m = int(input()), set(list(map(int,input().split()))) N, n = int(input()), set(list(map(int,input().split())))
for i in sorted(m.symmetric_difference(n)): print(i)
Here is HackeRank Symmetric Difference in Python solution - https://programmingoneonone.com/hackerrank-symmetric-difference-solution-in-python.html