title: Middle Of Three Using Minimum Comparisons 2
signature: class Solution {
  
      public Integer middleOfThreeUsingMinimumComparisons2(Integer a, Integer b, Integer c) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer a, Integer b, Integer c, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b, c,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(48, 46, 38, 46);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(93, 34, 11, 34);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(58, 78, 6, 58);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(13, 3, 23, 13);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Integer c, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b, c),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }