• + 0 comments

    I know the expectation is to use deque to solve this. But still went ahead with a simpler approach.

    test_cases = int(input()) for i in range(test_cases): ln = int(input()) blocks = list(map(int, input().split())) if max(blocks) == blocks[0] or max(blocks) == blocks[-1]: print("Yes") else: print("No")