title: Middle Of Three Using Minimum Comparisons 1
signature: middle_of_three_using_minimum_comparisons_1 <- 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(
          43L, 24L, 7L, 
          24L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          76L, 54L, 66L, 
          66L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          57L, 5L, 40L, 
          40L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          10L, 13L, 4L, 
          10L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          59L, 47L, 56L, 
          56L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          92L, 14L, 50L, 
          50L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          49L, 62L, 65L, 
          62L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          16L, 95L, 12L, 
          16L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          33L, 41L, 90L, 
          41L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          66L, 63L, 46L, 
          63L
      )))
  
  }
  
  main()
source_py: def middle_of_three_using_minimum_comparisons_1(a, b, c):
      if (a > b):
          if (b > c):
              return b
          elif (a > c):
              return c
          else:
              return a
      elif (a > c):
          return a
      elif (b > c):
          return c
      else:
          return b
source_cpp: int middle_of_three_using_minimum_comparisons_1(int a, int b, int c) {
    if ( a > b ) {
      if ( b > c ) return b;
      else if ( a > c ) return c;
      else return a;
    }
    else {
      if ( a > c ) return a;
      else if ( b > c ) return c;
      else return b;
    }
  }