We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Collections
- Piling Up!
- Discussions
Piling Up!
Piling Up!
Sort by
recency
|
960 Discussions
|
Please Login in order to post a comment
'''if the largest block isn't in the first or last position to begin with, the blocks are not stackable'''
for _ in range(int(input())): n = int(input()) blocks = list(map(int, input().split())) if blocks[0] == max(blocks) or blocks[-1] == max(blocks): print("Yes") else: print("No")
This is a solution without any dependencies
t = int(input()) for _ in range(t): n = int(input()) ls = list(map(int, input().split())) k = float('inf')