Count the number of distinct absolute values from a sorted array containing N integers. An absolute value of a number is | a | ( positive ) value of it.
The first line of input contains an integer T denoting the number of test cases. Then T test cases
The first line of each test case contains an integer N, where N is the size of the array A[ ].
The second line of each test case contains N space separated sorted integers, denoting elements of the array
Note: The array can contain duplicate values.
For each test case output a single line containing the no of distinct absolute values present in the array .
Remember to output the answer of each test case in a new line.
1 <= T <= 100
1 <= N <= 30
-10^9<= A[i] <= 3*10^9
-35 73 73 73
-44 -31 -6 6 46 52 52 55 93
-3 -2 0 3 4 5
Expected Time Complexity:
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.