title: Find The Maximum Element In An Array Which Is First Increasing And Then Decreasing
signature: class Solution {
  
      public Integer findTheMaximumElementInAnArrayWhichIsFirstIncreasingAndThenDecreasing(ArrayList<Integer> arr, Integer low, Integer high) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: findTheMaximumElementInAnArrayWhichIsFirstIncreasingAndThenDecreasing
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 94, "inputs": {"arr": [11, 15, 16, 19, 24, 25, 26, 28, 34, 34, 43, 61, 63, 66, 67, 72, 77, 79, 81, 83, 87, 94, 99], "low": 15, "high": 21}}, {"idx": 1, "outputs": 92, "inputs": {"arr": [8, 92], "low": 1, "high": 1}}, {"idx": 2, "outputs": 1, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "low": 23, "high": 15}}, {"idx": 3, "outputs": 92, "inputs": {"arr": [84, 39, 92, 89, 38, 75, 18, 39, 83, 67, 41, 46, 49, 27], "low": 8, "high": 13}}, {"idx": 4, "outputs": 86, "inputs": {"arr": [-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], "low": 31, "high": 34}}, {"idx": 5, "outputs": 1, "inputs": {"arr": [0, 1, 0], "low": 2, "high": 2}}, {"idx": 6, "outputs": 97, "inputs": {"arr": [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], "low": 20, "high": 31}}, {"idx": 7, "outputs": 86, "inputs": {"arr": [86, 20, -50, 74, -78, 86], "low": 3, "high": 5}}, {"idx": 8, "outputs": 1, "inputs": {"arr": [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], "low": 19, "high": 18}}, {"idx": 9, "outputs": 99, "inputs": {"arr": [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], "low": 28, "high": 22}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> arr, Integer low, Integer high, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(arr, low, high,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(8, 92)), 1, 1, 92);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(84, 39, 92, 89, 38, 75, 18, 39, 83, 67, 41, 46, 49, 27)), 8, 13, 92);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-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);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 1, 0)), 2, 2, 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(86, 20, -50, 74, -78, 86)), 3, 5, 86);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> arr, Integer low, Integer high, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, low, high),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__