BETA

Difficulty Level: Basic

Submissions: 1851 Accuracy:

37.28%

Make a Distinct Digit Array
       

Given an array A[] of n elements.The task is to make a sorted array which will contain all distinct digits present in A[].
 

Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer N, denoting the length of the array. Then in the next line are N space separated integers of the array. 

Output:
For each test case in a new line print the distinct array of digits.

Constraints:
1<=T<=100
1<=n<=200
1<=A[]<=1000


Example:
Input
:
2
3
131 11 48
4
111 222 333 446

Output:
1 3 4 8
1 2 3 4 6

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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