title: HackerRank Sherlock and Array performance
body: <p>I did this small algorithm to the HackerRank Sherlock and Array test, but this gets timeouts in 2 test cases. These test cases creates huge lists and i couldn't see what is wrong in terms of performance.</p>
  
  <p>This is the problem:</p>
  
  <p>Watson gives Sherlock an array AA of length NN. Then he asks him to determine if there exists an element in the array such that the sum of the elements on its left is equal to the sum of the elements on its right. If there are no elements to the left/right, then the sum is considered to be zero. 
  Formally, find an ii, such that, AA1+A+A2...A...Ai-1 =A=Ai+1+A+Ai+2...A...AN.</p>
  
  <p>Input Format 
  The first line contains TT, the number of test cases. For each test case, the first line contains NN, the number of elements in the array AA. The second line for each test case contains NN space-separated integers, denoting the array AA.</p>
  
  <p>Output Format 
  For each test case print YES if there exists an element in the array, such that the sum of the elements on its left is equal to the sum of the elements on its right; otherwise print NO.</p>
  
  <p>This is my code:</p>
  
  <pre><code>for turn in range(int(input())):
      lst_size = int(input())
      has_equal = False
  
      lst = list(map(int, input().split(" ")))
  
      if lst_size &gt; 2:
  
          for i in range(lst_size):
              sumleft = sum(lst[:i])
              sumright = sum(lst[(i+1):])
  
              if sumleft == sumright:
                  has_equal = True
                  break
  
      if has_equal:
          print("YES")
      else:
          print("NO")
  </code></pre>