Check Array Sorted For Each Case

Python Medium 5 views
Back to Questions

Problem Description

Read t testcases. Each testcase has n and array. Output YES if array is non-decreasing else NO.

Input Format

First integer t. For each: n then n integers.

Output Format

t lines YES/NO.

Sample Test Case

Input:
2 5 1 2 2 5 9 4 3 2 1 1
Output:
YES NO

Constraints

Sum of n over all testcases

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next