Skip to content
C

Find the Union of Two Arrays

Easyjavapythonccppjavascript

Given two arrays, create the set of every distinct value that appears in either array.

Input Format

The first line contains an integer N. The second line contains N space-separated integers (array A). The third line contains an integer M. The fourth line contains M space-separated integers (array B).

Output Format

Print the distinct values from either array in increasing order, separated by single spaces.

Input (stdin)

Output

Run your code to see output here...