You are viewing a single comment's thread. Return to all comments →
t=int(input())
while t:
size=int(input()) li=list(map(int, input().split())) mini=min(li) minindex=li.index(mini) modfirst=sorted(li[:minindex+1], reverse=True) modsecond=sorted(li[minindex:]) if li[:minindex+1]==modfirst and li[minindex:]==modsecond: print("Yes") else: print("No") t-=1
Seems like cookies are disabled on this browser, please enable them to open this website
Piling Up!
You are viewing a single comment's thread. Return to all comments →
t=int(input())
while t: