title: Middle Of Three Using Minimum Comparisons 1
signature: int middleOfThreeUsingMinimumComparisons1(int a, int b, int c) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual == expected;
  }
  
  string driver(int a, int b, int c, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, c), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(43, 24, 7, 24); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(76, 54, 66, 66); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(57, 5, 40, 40); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(10, 13, 4, 10); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(59, 47, 56, 56); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(92, 14, 50, 50); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(49, 62, 65, 62); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver(16, 95, 12, 16); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver(33, 41, 90, 41); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver(66, 63, 46, 63); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
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;
    }
  }