[Solution] Increasing Codeforces Solution | Solution Codeforces
You are given an array of positive integers. Determine if, by rearranging the elements, you can make the array strictly increasing. In other words, determine if it is possible to rearrange the elements such that holds.
The first line contains a single integer () — the number of test cases.
The first line of each test case contains a single integer () — the length of the array.
The second line of each test case contains integers () — the elements of the array.
For each test case, output "YES" (without quotes) if the array satisfies the condition, and "NO" (without quotes) otherwise.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
In the first test case any rearrangement will keep the array , which is not strictly increasing.
In the second test case, you can make the array .
No comments:
Post a Comment