[Solution] Minimum or Maximum CodeChef Solution | CodeChef Problem Solution 2022
From a hidden array of length , Stack constructs an array of length such that:
- For all , or .
For the given array of length , Stack wants you to check whether a possible array exists or not.
Input Format
- The first line of input contains a single integer , denoting the number of test cases. The description of test cases follow.
Solution Click Below:- CLICK HERE
- The first line of each test case contains an integer - the length of the array .
- The second line of each test case contains space-separated integers representing the array .
Output Format
For each test case, output in a single line YES
if exists, otherwise print NO
.
You may print each character of the string in uppercase or lowercase (for example, the strings YES
, yEs
, yes
, and yeS
will all be treated as identical).
No comments:
Post a Comment