#C13491. Find Unique Elements Between Two Lists

    ID: 43035 Type: Default 1000ms 256MiB

Find Unique Elements Between Two Lists

Find Unique Elements Between Two Lists

You are given two lists of integers. Your task is to determine which elements are unique to each list, i.e., appear in one list but not in the other.

For example, if the first list is [1, 2, 3, 5] and the second list is [2, 3, 4, 5], the unique elements are 1 from the first list and 4 from the second list, so the output should be:

[1, 4]

If both lists have no differing elements, print an empty line.

Note: The order of output should follow the order of first occurrence in the concatenated list (i.e. first list followed by the second list).

inputFormat

The input consists of two lines:

  • The first line contains space-separated integers representing the first list. If the line is empty, it represents an empty list.
  • The second line contains space-separated integers representing the second list. If the line is empty, it represents an empty list.

outputFormat

Print the unique elements separated by a single space in the order they appear in the concatenated list. If there are no unique elements, print an empty line.

## sample
1 2 3 5
2 3 4 5
1 4