Simple symmetric difference
Input
values_in_exactly_one([1, 2, 3], [3, 4])
Output
[1, 2, 4]
1 and 2 are only in the first; 4 is only in the second.
Full lesson preview
Return the unique values that are present in one collection but not both, presented in sorted order.
Problem statement
Task
Examples
Input
values_in_exactly_one([1, 2, 3], [3, 4])
Output
[1, 2, 4]
1 and 2 are only in the first; 4 is only in the second.
Input format
Output format
Constraints
Samples
Input
values_in_exactly_one(['a', 'b', 'b'], ['b', 'c'])
Output
['a', 'c']
Unique values only in one side are 'a' and 'c', returned sorted.