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.
# Enter your code here. Read input from STDIN. Print output to STDOUTdefexists_element(size,arr):sum_left=0sum_right=sum(arr)previous=0foridxinrange(0,size):current=arr[idx]sum_left+=previoussum_right-=currentifsum_left==sum_right:return"YES"previous=currentreturn"NO"test_cases=int(raw_input())foriinrange(0,test_cases):size=int(raw_input())arr=map(int,raw_input().split())printexists_element(size,arr)
Cookie support is required to access HackerRank
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 solution. Comments would be appreciated