79. Union of Two Arrays
EasySet
Print the distinct values present in either array, in increasing order.
Input format
Line 1: n Line 2: n integers Line 3: m Line 4: m integers
Output format
The union.
Example 1
Input
3 1 2 3 3 2 3 4
Output
1 2 3 4
Example 2
Input
2 5 5 1 5
Output
5
Constraints
1 ≤ n, m ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…