BETA

Difficulty Level:

Basic

Total Submissions: 4236 Accuracy:

27.74%

Remove duplicate elements from sorted Array (Function Problem)
     

Given a sorted array, your task to complete the function remove_duplicate which removes the duplicate  elements from the array .
The function remove_duplicate takes two arguments . The first argument is the sorted array A[ ] and the second argument is 'N' the size of the array and returns the size of the new converted array A[ ] with no duplicate element .

Input  :
The first line of input contains T denoting the no of test cases . Then T test cases follow . The first line of each test case contains an Integer N and the next line contains N space separated values of the array A[ ] .

Output:
For each test case output will be the transformed array with no duplicates.

Constraints:
1<=T<=100
1<=N<=100
1<=A[ ] <=100

Example:

Input  (To be used only for expected output) :
2
5
2 2 2 2 2 
3
1 2 2

Output
2
1 2



Note:The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.

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

Contributor: Amit Khandelwal


					   
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.