input: from typing import List
  
  
  def split_equal_sum(arr: List[int]) -> bool:
      """
      This function splits a given array into two parts with equal sum, if possible.
      If such a split exists, the function returns True; otherwise, it returns False.
      >>> split_equal_sum([1, 2, 3, 4])
      True
      >>> split_equal_sum([1, 2, 3, 10])
      False
      """
      n = len(arr)
      leftsum = 0
      rightsum = sum(arr)
      
      for i in range(n):
          rightsum -= arr[i]
          if leftsum == rightsum:
              return True
          leftsum += arr[i]
      return False
output:     n = len(arr)
      leftsum = 0
      rightsum = sum(arr)
      
      for i in range(n):
          rightsum -= arr[i]
          if leftsum == rightsum:
              return True
          leftsum += arr[i]
      return False