title: Check Exist Two Elements Array Whose Sum Equal Sum Rest Array
signature: function checkExistTwoElementsArrayWhoseSumEqualSumRestArray(arr, n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(arr, n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver([2, 11, 5, 1, 4, 7], 6, false);
    console.log(`TEST-0...${result}`);
  
    result = driver([2, 4, 2, 1, 11, 15], 6, false);
    console.log(`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, false);
    console.log(`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);
    console.log(`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, false);
    console.log(`TEST-4...${result}`);
  
    result = driver([1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], 10, false);
    console.log(`TEST-5...${result}`);
  
    result = driver([21, 26, 26, 27, 61, 62, 96], 6, false);
    console.log(`TEST-6...${result}`);
  
    result = driver([-54, 86, 20, 26], 3, false);
    console.log(`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, false);
    console.log(`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, false);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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;
  }