title: Find Minimum Element In A Sorted And Rotated Array
signature: def find_minimum_element_in_a_sorted_and_rotated_array(arr, low, high):
source_py: def find_minimum_element_in_a_sorted_and_rotated_array(arr, low, high):
      if (high < low):
          return arr[0]
      if (high == low):
          return arr[low]
      mid = int(((low + high) / 2))
      if ((mid < high) and (arr[(mid + 1)] < arr[mid])):
          return arr[(mid + 1)]
      if ((mid > low) and (arr[mid] < arr[(mid - 1)])):
          return arr[mid]
      if (arr[high] > arr[mid]):
          return find_minimum_element_in_a_sorted_and_rotated_array(arr, low, (mid - 1))
      return find_minimum_element_in_a_sorted_and_rotated_array(arr, (mid + 1), high)
source_cpp: int find_minimum_element_in_a_sorted_and_rotated_array(vector<int> arr, int low, int high) {
    if ( high < low ) return arr [ 0 ];
    if ( high == low ) return arr [ low ];
    int mid = low + ( high - low ) / 2;
    if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return arr [ mid + 1 ];
    if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return arr [ mid ];
    if ( arr [ high ] > arr [ mid ] ) return find_minimum_element_in_a_sorted_and_rotated_array ( arr, low, mid - 1 );
    return find_minimum_element_in_a_sorted_and_rotated_array ( arr, mid + 1, high );
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(arr, low, high, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              arr, low, high),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver([16, 22, 50, 64, 68, 79, 84, 88, 89], 4, 6, 68)
      print(f"TEST-0...{result}")
  
      result = driver([88, -38, 46, 24, -52, -12, -90, 28, 18, 14, -72, 58, -98, 28, -84, 44, -42, -32, -22, -22, -82, -30, 90, 18, 62, 62, 92, 6, 60, 28, -90, 92, 82, 62, 98, -68, 48, -74, -8, 50, 62, 24, 30, -86, 98, -96, -98], 42, 31, 88)
      print(f"TEST-1...{result}")
  
      result = driver([0, 0, 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, 1, 1, 1, 1], 28, 21, 0)
      print(f"TEST-2...{result}")
  
      result = driver([26, 66, 94, 28, 38, 31, 92, 66, 81, 8, 36, 64, 80, 32, 48, 71, 72, 54, 61, 60, 89], 19, 17, 26)
      print(f"TEST-3...{result}")
  
      result = driver([-46, -26, -22, -14, 46, 62], 4, 4, 46)
      print(f"TEST-4...{result}")
  
      result = driver([0, 1, 1, 1], 2, 2, 1)
      print(f"TEST-5...{result}")
  
      result = driver([14, 81, 87], 1, 1, 81)
      print(f"TEST-6...{result}")
  
      result = driver([4], 0, 0, 4)
      print(f"TEST-7...{result}")
  
      result = driver([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 15, 17, 1)
      print(f"TEST-8...{result}")
  
      result = driver([3, 41, 40, 53, 82, 9, 90, 43, 90, 59, 37, 21, 92, 98, 36, 99, 35, 67, 24, 29, 40, 31, 46, 12, 29, 8, 93, 67, 44, 83, 71, 29, 22, 32, 33, 11, 44, 97, 84, 44, 8, 10, 31, 50, 22, 8], 42, 31, 3)
      print(f"TEST-9...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.entry_fn_name: find_minimum_element_in_a_sorted_and_rotated_array
question_info.test_list: [{"idx": 0, "outputs": 68, "inputs": {"arr": [16, 22, 50, 64, 68, 79, 84, 88, 89], "low": 4, "high": 6}}, {"idx": 1, "outputs": 88, "inputs": {"arr": [88, -38, 46, 24, -52, -12, -90, 28, 18, 14, -72, 58, -98, 28, -84, 44, -42, -32, -22, -22, -82, -30, 90, 18, 62, 62, 92, 6, 60, 28, -90, 92, 82, 62, 98, -68, 48, -74, -8, 50, 62, 24, 30, -86, 98, -96, -98], "low": 42, "high": 31}}, {"idx": 2, "outputs": 0, "inputs": {"arr": [0, 0, 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, 1, 1, 1, 1], "low": 28, "high": 21}}, {"idx": 3, "outputs": 26, "inputs": {"arr": [26, 66, 94, 28, 38, 31, 92, 66, 81, 8, 36, 64, 80, 32, 48, 71, 72, 54, 61, 60, 89], "low": 19, "high": 17}}, {"idx": 4, "outputs": 46, "inputs": {"arr": [-46, -26, -22, -14, 46, 62], "low": 4, "high": 4}}, {"idx": 5, "outputs": 1, "inputs": {"arr": [0, 1, 1, 1], "low": 2, "high": 2}}, {"idx": 6, "outputs": 81, "inputs": {"arr": [14, 81, 87], "low": 1, "high": 1}}, {"idx": 7, "outputs": 4, "inputs": {"arr": [4], "low": 0, "high": 0}}, {"idx": 8, "outputs": 1, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "low": 15, "high": 17}}, {"idx": 9, "outputs": 3, "inputs": {"arr": [3, 41, 40, 53, 82, 9, 90, 43, 90, 59, 37, 21, 92, 98, 36, 99, 35, 67, 24, 29, 40, 31, 46, 12, 29, 8, 93, 67, 44, 83, 71, 29, 22, 32, 33, 11, 44, 97, 84, 44, 8, 10, 31, 50, 22, 8], "low": 42, "high": 31}}]
question_info.entry_cls_name: Solution