title: Middle Of Three Using Minimum Comparisons
signature: function middleOfThreeUsingMinimumComparisons(a, b, c) {
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(a, b, c, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, c),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(56, 5, 82, 56);
    console.log(`TEST-0...${result}`);
  
    result = driver(56, 60, 17, 56);
    console.log(`TEST-1...${result}`);
  
    result = driver(36, 56, 51, 51);
    console.log(`TEST-2...${result}`);
  
    result = driver(71, 54, 6, 54);
    console.log(`TEST-3...${result}`);
  
    result = driver(3, 70, 81, 70);
    console.log(`TEST-4...${result}`);
  
    result = driver(84, 57, 47, 57);
    console.log(`TEST-5...${result}`);
  
    result = driver(30, 80, 85, 80);
    console.log(`TEST-6...${result}`);
  
    result = driver(82, 54, 32, 54);
    console.log(`TEST-7...${result}`);
  
    result = driver(90, 70, 55, 70);
    console.log(`TEST-8...${result}`);
  
    result = driver(38, 4, 5, 5);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    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;
  }