#C5079. Distinct Subsequence Possibility
Distinct Subsequence Possibility
Distinct Subsequence Possibility
You are given several queries. In each query, a sequence of integers is provided. Your task is to determine whether it is possible to choose a subsequence from the given sequence such that all elements in the subsequence are distinct. In other words, check if the sequence contains no duplicate elements.
Formally, for a given query with an integer \( m \) (the number of elements) and a sequence \( b = [b_1, b_2, \dots, b_m] \), you should output "YES" if all \( b_i \) are distinct, and "NO" otherwise.
Note: A subsequence with all distinct elements exists if and only if the given sequence has no duplicate elements.
inputFormat
The first line contains an integer \( T \) denoting the number of queries. For each query, the first line contains an integer \( m \) representing the size of the sequence. The next line contains \( m \) space-separated integers forming the sequence \( b \).
outputFormat
For each query, output a single line containing "YES" if the sequence has all distinct elements, or "NO" if any duplicate exists.
## sample3
5
1 2 3 4 5
5
1 2 2 3 4
4
4 4 4 4
YES
NO
NO
</p>