title: Integer Positive Value Positive Negative Value Array 1
signature: integer_positive_value_positive_negative_value_array_1 <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-09
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(49L, 98L), 1L, 
          49.0
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(82L, 66L, -68L, 24L, -10L), 2L, 
          74.0
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 8L, 
          0.125
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(56L, 3L, 18L, 5L, 20L, 56L, 47L, 29L, 60L, 98L, 60L, 40L, 42L, 2L, 54L, 56L, 91L, 8L, 93L, 14L, 31L, 27L, 61L, 49L, 23L, 12L, 71L), 25L, 
          41.72
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-94L, -94L, -92L, -86L, -50L, -48L, -6L, 8L, 28L, 40L, 44L, 58L, 62L, 72L, 94L), 12L, 
          -146.0
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 1L), 36L, 
          0.5833333333333334
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(16L, 56L, 56L), 1L, 
          16.0
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(74L, -90L, -92L, 30L, -18L, 66L, -66L, 22L), 5L, 
          -96.0
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 7L, 
          0.5714285714285714
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(21L, 64L, 82L, 78L, 30L, 34L, 35L), 5L, 
          55.0
      )))
  
  }
  
  main()
source_py: def integer_positive_value_positive_negative_value_array_1(arr, n):
      neg = 0
      pos = 0
      sum = 0
      for i in range(0, n):
          sum += arr[i]
          if (arr[i] < 0):
              neg += 1
          else:
              pos += 1
      return (sum / abs((neg - pos)))
source_cpp: int integer_positive_value_positive_negative_value_array_1(vector<int> arr, int n) {
    int neg = 0, pos = 0;
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      sum += arr [ i ];
      if ( arr [ i ] < 0 ) neg ++;
      else pos ++;
    }
    return ( sum / abs ( neg - pos ) );
  }