Problem
Input format
The program reads from standard input: - a natural number `n`, followed by `n` integers (sequence `a`); - a natural number `m`, followed by `m` integers (sequence `b`). - `1 <= n, m <= 1000` - `-1000000 <= values <= 1000000` - the sequences are sorted in ascending order and may contain duplicates
Output format
The program prints on the first line the number `k` of distinct values in the symmetric difference. If `k > 0`, the second line contains the `k` values in ascending order, separated by single spaces. If `k = 0`, no further line is printed.
Example
5 1 2 3 4 5 4 2 4 6 8
5 1 3 5 6 8
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
5 1 2 3 4 5 4 2 4 6 8
5 1 3 5 6 8
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.