Challenge Complexity Sequence
In our coding dojo at Codedamn, we have a group of learners tackling various challenges. Your task is to assist in evaluating whether these learners are progressing through these challenges in a sequence where the complexity either escalates or remains constant, without any decline. In simpler terms, ensure that no learner moves from a challenge of difficulty to one of lesser difficulty , where .
Declare the outcome “Yes” if the sequence of challenge difficulties is non-descending, and “No” if otherwise.
Input Format
- The initial line will present a single integer , indicating the count of scenarios to assess.
- Following this, each scenario is described over lines.
- The first line details a single integer , representing the total number of challenges completed by the learners.
- The subsequent line lists integers separated by spaces, denoting the difficulty levels of the completed challenges in sequence.
Output Format
- For every scenario evaluated, respond on a new line with “Yes” if the sequence of challenge difficulties is non-descending, and “No” if it is not. The response should disregard quotation marks.
Responses can be in any mixture of uppercase and lowercase letters, with yes
, YeS
, and YES
being considered identical.
Constraints
- difficulty level of each challenge
Sample Test Cases and Explanations
Case #1:
Input:
4 3 1 2 3 3 1 1 2 5 100 200 300 400 350 5 1000 2000 5000 3000 1000
Output:
Yes Yes No No
Explanation
Test case : . The learners have tackled challenges in a strictly ascending order, validating the answer as "Yes".
Test case : . Here, the learners have engaged with challenges in a non-descending order, justifying the answer "Yes".
Test case : Given that , the sequence illustrates learners tackling a -difficulty challenge prior to a -difficulty one, contradicting the non-descending order requirement, thus the answer is "No".
Test case : The scenario where demonstrates learners moving from a higher to a lower difficulty challenge, breaching the non-descending sequence rule, thereby rendering the answer "No".