You are viewing a single comment's thread. Return to all comments →
Simple and easy :
for _ in range(int(input())): n,arr=int(input()),list(map(int,input().split())) right,left,flag=0,sum(arr),0 for j in arr: if right==left-j:flag=1 right,left=right+j,left-j print('YES'if flag==1 else 'NO')
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →
Python 3 O(n) Approach :-)
Simple and easy :