title: Middle Of Three Using Minimum Comparisons 2
signature: middle_of_three_using_minimum_comparisons_2 <- function(a, b, c) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, b, c, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a, b, c), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          48L, 46L, 38L, 
          46L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          93L, 34L, 11L, 
          34L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          58L, 78L, 6L, 
          58L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          13L, 3L, 23L, 
          13L
      )))
  
  }
  
  main()
source_py: def middle_of_three_using_minimum_comparisons_2(a, b, c):
      x = (a - b)
      y = (b - c)
      z = (a - c)
      if ((x * y) > 0):
          return b
      elif ((x * z) > 0):
          return
      else:
          return a
source_cpp: int middle_of_three_using_minimum_comparisons_2(int a, int b, int c) {
    int x = a - b;
    int y = b - c;
    int z = a - c;
    if ( x * y > 0 ) return b;
    else if ( x * z > 0 ) return c;
    else return a;
  }