Remove Duplicates from unsorted array
Submissions: 4985   Accuracy:

41.7%

  Difficulty: Basic   Marks: 1

Given an array of integers which may or may not contain duplicate elements. Your task is to print the array after removing duplicate elements, if present.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n denoting the size of the array. Then following line contains 'n' integers forming the array.

Output:
Output the array with no duplicate element present, in the same order as input.

Constraints:
1<=T<=100
1<=n<=100
1<=a[i]<=100

Example:
Input:
1

6
1 2 3 1 4 2

Output:
1 2 3 4

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

Contributor: Shubham Chaudhary
Author: Shubham Chaudhary gfg


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.