title: Find The Maximum Element In An Array Which Is First Increasing And Then Decreasing
signature: find_the_maximum_element_in_an_array_which_is_first_increasing_and_then_decreasing <- function(arr, low, high) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, low, high, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, low, high), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(11L, 15L, 16L, 19L, 24L, 25L, 26L, 28L, 34L, 34L, 43L, 61L, 63L, 66L, 67L, 72L, 77L, 79L, 81L, 83L, 87L, 94L, 99L), 15L, 21L, 
          94L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(8L, 92L), 1L, 1L, 
          92L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 23L, 15L, 
          1L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(84L, 39L, 92L, 89L, 38L, 75L, 18L, 39L, 83L, 67L, 41L, 46L, 49L, 27L), 8L, 13L, 
          92L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-98L, -94L, -88L, -84L, -74L, -72L, -58L, -52L, -48L, -48L, -46L, -42L, -42L, -32L, -30L, -30L, -18L, -10L, -8L, -8L, -6L, -4L, 4L, 6L, 28L, 30L, 34L, 38L, 44L, 48L, 56L, 58L, 60L, 64L, 86L), 31L, 34L, 
          86L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 1L, 0L), 2L, 2L, 
          1L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(5L, 9L, 10L, 16L, 18L, 19L, 23L, 24L, 26L, 33L, 37L, 44L, 46L, 54L, 55L, 57L, 58L, 59L, 63L, 64L, 70L, 75L, 77L, 81L, 83L, 84L, 85L, 85L, 88L, 89L, 96L, 97L, 99L), 20L, 31L, 
          97L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(86L, 20L, -50L, 74L, -78L, 86L), 3L, 5L, 
          86L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 19L, 18L, 
          1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(16L, 57L, 65L, 61L, 17L, 63L, 7L, 35L, 69L, 91L, 30L, 44L, 99L, 80L, 6L, 80L, 56L, 8L, 84L, 95L, 20L, 73L, 30L, 62L, 77L, 26L, 66L, 61L, 61L, 45L), 28L, 22L, 
          99L
      )))
  
  }
  
  main()
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;
  }