HackerRank Python- Symmetric Difference
Given 2 sets of integers, M and N, print their symmetric difference in ascending order. The term symmetric difference indicates those values that exist in either M or N but do not exist in both.
- # Enter your code here. Read input from STDIN. Print output to STDOUT
-
- if __name__ == "__main__":
- M = int(input().strip())
- set_m = set(map(int, input().strip().split(' ')))
-
- N = int(input().strip())
- set_n = set(map(int, input().strip().split(' ')))
-
- for el in sorted(set_m ^ set_n):
- print(el)