title: Find The Maximum Element In An Array Which Is First Increasing And Then Decreasing
signature: int findTheMaximumElementInAnArrayWhichIsFirstIncreasingAndThenDecreasing(vector<int> arr, int low, int high) {
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(vector<int> arr, int low, int high, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high), 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({11, 15, 16, 19, 24, 25, 26, 28, 34, 34, 43, 61, 63, 66, 67, 72, 77, 79, 81, 83, 87, 94, 99}, 15, 21, 94); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver({8, 92}, 1, 1, 92); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 23, 15, 1); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver({84, 39, 92, 89, 38, 75, 18, 39, 83, 67, 41, 46, 49, 27}, 8, 13, 92); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver({-98, -94, -88, -84, -74, -72, -58, -52, -48, -48, -46, -42, -42, -32, -30, -30, -18, -10, -8, -8, -6, -4, 4, 6, 28, 30, 34, 38, 44, 48, 56, 58, 60, 64, 86}, 31, 34, 86); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 1, 0}, 2, 2, 1); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver({5, 9, 10, 16, 18, 19, 23, 24, 26, 33, 37, 44, 46, 54, 55, 57, 58, 59, 63, 64, 70, 75, 77, 81, 83, 84, 85, 85, 88, 89, 96, 97, 99}, 20, 31, 97); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver({86, 20, -50, 74, -78, 86}, 3, 5, 86); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 19, 18, 1); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver({16, 57, 65, 61, 17, 63, 7, 35, 69, 91, 30, 44, 99, 80, 6, 80, 56, 8, 84, 95, 20, 73, 30, 62, 77, 26, 66, 61, 61, 45}, 28, 22, 99); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def find_the_maximum_element_in_an_array_which_is_first_increasing_and_then_decreasing(arr, low, high):
      max = arr[low]
      i = low
      for i in range((high + 1)):
          if (arr[i] > max):
              max = arr[i]
      return max
source_cpp: int find_the_maximum_element_in_an_array_which_is_first_increasing_and_then_decreasing(vector<int> arr, int low, int high) {
    int max = arr [ low ];
    int i;
    for ( i = low + 1;
    i <= high;
    i ++ ) {
      if ( arr [ i ] > max ) max = arr [ i ];
      else break;
    }
    return max;
  }