title: Middle Of Three Using Minimum Comparisons 1
signature: function middleOfThreeUsingMinimumComparisons1(a: number, b: number, c: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(a: number, b: number, c: number, expected:number): string {
      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(43, 24, 7, 24);
    console.log(`TEST-0...${result}`);
  
    result = driver(76, 54, 66, 66);
    console.log(`TEST-1...${result}`);
  
    result = driver(57, 5, 40, 40);
    console.log(`TEST-2...${result}`);
  
    result = driver(10, 13, 4, 10);
    console.log(`TEST-3...${result}`);
  
    result = driver(59, 47, 56, 56);
    console.log(`TEST-4...${result}`);
  
    result = driver(92, 14, 50, 50);
    console.log(`TEST-5...${result}`);
  
    result = driver(49, 62, 65, 62);
    console.log(`TEST-6...${result}`);
  
    result = driver(16, 95, 12, 16);
    console.log(`TEST-7...${result}`);
  
    result = driver(33, 41, 90, 41);
    console.log(`TEST-8...${result}`);
  
    result = driver(66, 63, 46, 63);
    console.log(`TEST-9...${result}`);
  
  };
  
  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;
    }
  }