Repeated I.Ds
Submissions: 3032   Accuracy:

45.39%

  Difficulty: Basic   Marks: 1

Raghav is given a task to select at most 10 employees for a company project. Each employee is  represented by a single digit I.D. number which is unique for all the selected employees of the project. Raghav has a technical problem in his system which printed I.D. number multiple times. Help him to get rid of the repeated numbers.

Input:
First line contain T test cases. Second line contain the Total number (N) of employees where repeated I.Ds. are present. Third line contain the array A[N] of size N containing the I.Ds. of employees.

Output:
Print the non repeated selected I.D. of employees in a new line in the same sequence they appear in Input.

Constraints:
1<=T<=100
0<=N<=1000

Example:
Input:

5
5
8 8 6 2 1
6
7 6 7 4 2 7
9
1 9 6 7 4 8 1 4 5
3
1 1 1
5
0 1 0 1 2
Output:
8 6 2 1
7 6 4 2
1 9 6 7 4 8 5
1
0 1 2

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

Author: Sangeet Singh


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.