title: Maximum Equlibrium Sum Array
signature: function maximumEqulibriumSumArray(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([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 19, 5);
    console.log(`TEST-0...${result}`);
  
    result = driver([0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0], 38, 9);
    console.log(`TEST-1...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def maximum_equlibrium_sum_array(arr, n):
      res = ((- sys.maxsize) - 1)
      for i in range(n):
          prefix_sum = arr[i]
          for j in range(i):
              prefix_sum += arr[j]
          suffix_sum = arr[i]
          j = (n - 1)
          while (j > i):
              suffix_sum += arr[j]
              j -= 1
          if (prefix_sum == suffix_sum):
              res = max(res, prefix_sum)
      return res
source_cpp: int maximum_equlibrium_sum_array(vector<int> arr, int n) {
    int res = INT_MIN;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int prefix_sum = arr [ i ];
      for ( int j = 0;
      j < i;
      j ++ ) prefix_sum += arr [ j ];
      int suffix_sum = arr [ i ];
      for ( int j = n - 1;
      j > i;
      j -- ) suffix_sum += arr [ j ];
      if ( prefix_sum == suffix_sum ) res = max ( res, prefix_sum );
    }
    return res;
  }