title: Check Exist Two Elements Array Whose Sum Equal Sum Rest Array
signature: def check_exist_two_elements_array_whose_sum_equal_sum_rest_array(arr, n):
source_py: def check_exist_two_elements_array_whose_sum_equal_sum_rest_array(arr, n):
      s = set()
      sum = 0
      for i in range(n):
          sum += arr[i]
      if ((sum % 2) != 0):
          return False
      sum = (sum / 2)
      for i in range(n):
          val = (sum - arr[i])
          if (arr[i] not in s):
              s.add(arr[i])
          if (val in s):
              print('Pair elements are', arr[i], 'and', int(val))
source_cpp: bool check_exist_two_elements_array_whose_sum_equal_sum_rest_array(vector<int> arr, int n) {
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) sum += arr [ i ];
    if ( sum % 2 != 0 ) return false;
    sum = sum / 2;
    unordered_set < int > s;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int val = sum - arr [ i ];
      if ( s . find ( val ) != s . end ( ) ) {
        return true;
      }
      s . insert ( arr [ i ] );
    }
    return false;
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(arr, n, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              arr, n),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver([2, 11, 5, 1, 4, 7], 6, None)
      print(f"TEST-0...{result}")
  
      result = driver([2, 4, 2, 1, 11, 15], 6, False)
      print(f"TEST-1...{result}")
  
      result = driver([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 13, None)
      print(f"TEST-2...{result}")
  
      result = driver([69, 6, 24, 30, 75, 37, 61, 76, 19, 18, 90, 9, 49, 24, 58, 97, 18, 85, 24, 93, 71, 98, 92, 59, 75, 75, 75, 70, 35, 58, 50, 1, 64, 66, 33], 18, False)
      print(f"TEST-3...{result}")
  
      result = driver([-94, -94, -92, -74, -60, -58, -56, -44, -42, -40, -28, -14, 2, 4, 14, 20, 24, 28, 40, 42, 42, 66, 78, 78, 80, 82, 96], 26, None)
      print(f"TEST-4...{result}")
  
      result = driver([1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], 10, False)
      print(f"TEST-5...{result}")
  
      result = driver([21, 26, 26, 27, 61, 62, 96], 6, False)
      print(f"TEST-6...{result}")
  
      result = driver([-54, 86, 20, 26], 3, None)
      print(f"TEST-7...{result}")
  
      result = driver([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 4, None)
      print(f"TEST-8...{result}")
  
      result = driver([44, 35, 26, 15, 56, 6, 36, 53, 15, 66, 20, 53, 99, 96, 51, 12, 61, 19, 79, 40, 99, 42, 86, 8, 11, 54, 93, 46, 23, 47, 41, 26, 66, 5, 86, 52, 64, 51, 4, 21, 63, 14, 7, 53, 31, 8, 9, 63], 31, None)
      print(f"TEST-9...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.entry_fn_name: check_exist_two_elements_array_whose_sum_equal_sum_rest_array
question_info.test_list: [{"idx": 0, "outputs": null, "inputs": {"arr": [2, 11, 5, 1, 4, 7], "n": 6}}, {"idx": 1, "outputs": false, "inputs": {"arr": [2, 4, 2, 1, 11, 15], "n": 6}}, {"idx": 2, "outputs": null, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 13}}, {"idx": 3, "outputs": false, "inputs": {"arr": [69, 6, 24, 30, 75, 37, 61, 76, 19, 18, 90, 9, 49, 24, 58, 97, 18, 85, 24, 93, 71, 98, 92, 59, 75, 75, 75, 70, 35, 58, 50, 1, 64, 66, 33], "n": 18}}, {"idx": 4, "outputs": null, "inputs": {"arr": [-94, -94, -92, -74, -60, -58, -56, -44, -42, -40, -28, -14, 2, 4, 14, 20, 24, 28, 40, 42, 42, 66, 78, 78, 80, 82, 96], "n": 26}}, {"idx": 5, "outputs": false, "inputs": {"arr": [1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], "n": 10}}, {"idx": 6, "outputs": false, "inputs": {"arr": [21, 26, 26, 27, 61, 62, 96], "n": 6}}, {"idx": 7, "outputs": null, "inputs": {"arr": [-54, 86, 20, 26], "n": 3}}, {"idx": 8, "outputs": null, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 4}}, {"idx": 9, "outputs": null, "inputs": {"arr": [44, 35, 26, 15, 56, 6, 36, 53, 15, 66, 20, 53, 99, 96, 51, 12, 61, 19, 79, 40, 99, 42, 86, 8, 11, 54, 93, 46, 23, 47, 41, 26, 66, 5, 86, 52, 64, 51, 4, 21, 63, 14, 7, 53, 31, 8, 9, 63], "n": 31}}]
question_info.entry_cls_name: Solution