#K53492. Longest Distinct Subsequence
Longest Distinct Subsequence
Longest Distinct Subsequence
You are given $t$ test cases. For each test case, you are provided with an integer $n$ and an array of $n$ integers. Your task is to determine the maximum length of a subsequence containing only distinct integers. In other words, for each test case, you need to compute the number of unique elements in the given array.
Note: The subsequence can be formed by selecting elements from the array without changing their order, but here you only need to count the unique numbers.
Example:
Input: 1 5 1 2 3 4 5</p>Output: 5
inputFormat
The first line of input contains an integer $t$, representing the number of test cases. For each test case, the first line contains an integer $n$, representing the number of elements in the array. The second line contains $n$ space-separated integers.
Input is read from standard input (stdin).
outputFormat
For each test case, output a single line containing the maximum length of a subsequence with all distinct integers.
Output should be written to standard output (stdout).
## sample3
5
1 2 3 4 5
6
1 2 2 3 3 4
7
4 4 4 4 4 4 4
5
4
1
</p>