title: Middle Of Three Using Minimum Comparisons 2
signature: function middleOfThreeUsingMinimumComparisons2(a: number, b: number, c: number): number {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 46, "inputs": {"a": 48, "b": 46, "c": 38}}, {"idx": 1, "outputs": 34, "inputs": {"a": 93, "b": 34, "c": 11}}, {"idx": 2, "outputs": 58, "inputs": {"a": 58, "b": 78, "c": 6}}, {"idx": 3, "outputs": 13, "inputs": {"a": 13, "b": 3, "c": 23}}]
question_info.entry_cls_name: Solution
question_info.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(48, 46, 38, 46);
    console.log(`TEST-0...${result}`);
  
    result = driver(93, 34, 11, 34);
    console.log(`TEST-1...${result}`);
  
    result = driver(58, 78, 6, 58);
    console.log(`TEST-2...${result}`);
  
    result = driver(13, 3, 23, 13);
    console.log(`TEST-3...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: middleOfThreeUsingMinimumComparisons2
question_info.test_case_ids: 0 1 2 3
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js