Two sequences of integers a and b are given, both sorted in ascending order. Print the values that appear in exactly one of the two sequences (in a but not in b, or in b but not in a), each value appearing once, in ascending order. This result is called the symmetric difference A xor B.
The required solution is a single pass with two indices, in merge style: when the two current values differ, the smaller one enters the result; when they are equal, both values cancel each other and you skip all occurrences of them.