You are viewing a single comment's thread. Return to all comments →
here is my solution and works
T =int(input()) pile=[] bandera=True for i in range (T): n=int(input()) bloques=list(map(int, input().split())) pile.append([n,bloques]) for repeticiones, bloques in pile: while len(bloques)>=2: top=max(bloques[0], bloques[-1]) bloques.remove(top) if(top >= bloques[-1]): bloques.pop() bandera=True else: bandera= False break print("Yes" if bandera else "No")
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 →
here is my solution and works