# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Limits
1s, 512 MB

Given two sets of integers, print the set containing the union of the two input sets.

For example, given the sets:

- {1, 3, 5, 7, 8}
- {2, 3, 4, 7, 9}

The union of the two sets is:

- {1, 2, 3, 4, 5, 7, 8, 9}

You can learn more about set union here).

The first line of the input will contain two integers **N** and **M** (0 < N, M < 100).

The following line will contain N integers, the members of the first set.

The line after that will contain M integers, the members of the second set.

The members of both sets will be given in increasing order.

Print the members of the union set in the same line, separated by space sorted in increasing order.

Input | Output |
---|---|

5 5 1 3 5 7 8 2 3 4 7 9 | 1 2 3 4 5 7 8 9 |

83% Solution Ratio

kimiyukiEarliest,

YouKnowWhoFastest, 0.0s

rased_299Lightest, 0 B

saitotaShortest, 26B

Login to submit