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.
python 3 code, easy to understand :) . It takes linear time
defsolve(a):# Complete this functionsummy=sum(a)l=len(a)lefty=0foriinrange(len(a)):current=a[i]summy-=currentiflefty==summy:return'YES'lefty+=currentreturn'NO'
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →
python 3 code, easy to understand :) . It takes linear time