Skip to content

Instantly share code, notes, and snippets.

@abhinavkorpal
Created April 7, 2017 09:54
Show Gist options
  • Save abhinavkorpal/66d86cb959cbc57160d9f505a1a49cf8 to your computer and use it in GitHub Desktop.
Save abhinavkorpal/66d86cb959cbc57160d9f505a1a49cf8 to your computer and use it in GitHub Desktop.
Piling Up
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