title: Middle Of Three Using Minimum Comparisons
signature: middle_of_three_using_minimum_comparisons <- 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(
          56L, 5L, 82L, 
          56L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          56L, 60L, 17L, 
          56L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          36L, 56L, 51L, 
          51L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          71L, 54L, 6L, 
          54L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          3L, 70L, 81L, 
          70L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          84L, 57L, 47L, 
          57L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          30L, 80L, 85L, 
          80L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          82L, 54L, 32L, 
          54L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          90L, 70L, 55L, 
          70L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          38L, 4L, 5L, 
          5L
      )))
  
  }
  
  main()
source_py: def middle_of_three_using_minimum_comparisons(a, b, c):
      if (((a < b) and (b < c)) or ((c < b) and (b < a))):
          return b
      if (((b < a) and (a < c)) or ((c < a) and (a < b))):
          return a
      else:
          return c
source_cpp: int middle_of_three_using_minimum_comparisons(int a, int b, int c) {
    if ( ( a < b && b < c ) || ( c < b && b < a ) ) return b;
    else if ( ( b < a && a < c ) || ( c < a && a < b ) ) return a;
    else return c;
  }