Merge and Sort
Submissions: 1405   Accuracy:

37.17%

  Difficulty: Basic   Marks: 1

Input N number of arrays and print the merged array in ascending order containing only unique elements.
Input:
The first line consists of T test cases and then next line consists of number of arrays denoted by N and then next of each N lines contain a number n denoting the number of elements in an array.
Output:
Output in one line the merged array sorted in ascending order.
Constraints:
1<=T<=50
1<=N<=4
1<=Ai<=100
Example:
Input:
1
3
3
1 2 8
2
4 9
3
1 2 8
Output:
1 2 4 8 9

** For More Input/Output Examples Use 'Expected Output' option **

Author: Ayush Saluja


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.