Absolute distinct count
Submissions: 1175   Accuracy:

35.31%

  Difficulty: Basic   Marks: 1

Given a sorted array of integers, return the number of distinct absolute values among the elements of the array. 

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N,N is the size of array.
The second line of each test case contains N input C[i].

Output:

Print the number of distinct absolute values.

Constraints:

1 ≤ T ≤ 50
1 ≤ N ≤ 100
-5000 ≤ C[i] ≤ 5000

Example:

Input:

2

5

-1 -1 0 1 2

4

0 0 0 0

Output:

3

1

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

Author: rajatjha


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.