Created
April 7, 2017 09:54
-
-
Save abhinavkorpal/66d86cb959cbc57160d9f505a1a49cf8 to your computer and use it in GitHub Desktop.
Piling Up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for t in range(input()): | |
| input() | |
| lst = map(int, raw_input().split()) | |
| l = len(lst) | |
| i = 0 | |
| while i < l - 1 and lst[i] >= lst[i+1]: | |
| i += 1 | |
| while i < l - 1 and lst[i] <= lst[i+1]: | |
| i += 1 | |
| print "Yes" if i == l - 1 else "No" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment