#C13198. Symmetric Difference
Symmetric Difference
Symmetric Difference
Given two lists of integers, your task is to compute their symmetric difference. The symmetric difference between two sets ( A ) and ( B ) is defined as:
[ A \triangle B = (A \setminus B) \cup (B \setminus A) ]
In other words, you need to find all the elements that appear in exactly one of the two lists. The output should be the symmetric difference sorted in increasing order. If there are no elements in the symmetric difference, output an empty line.
inputFormat
The input consists of two lines:
- The first line contains space-separated integers representing the first list (or it may be empty).
- The second line contains space-separated integers representing the second list (or it may be empty).
outputFormat
Output a single line containing the symmetric difference as space-separated integers in increasing order. If the symmetric difference is empty, output an empty line.## sample
1 2 3
4 5 6
1 2 3 4 5 6