



'''simple docstring'''






def 					snake_case_      (  lowerCAmelCase_ ,     lowerCAmelCase_	)->	int:





       '''simple docstring'''


       for index, item in enumerate(lowerCAmelCase_	):
              if item == target:
                     return index
       return -1




def 					snake_case_      (  lowerCAmelCase_ ,     lowerCAmelCase_ ,     lowerCAmelCase_ ,     lowerCAmelCase_	)->	int:





       '''simple docstring'''


       if not (0 <= high < len(lowerCAmelCase_	) and 0 <= low < len(lowerCAmelCase_	)):
              raise Exception("""Invalid upper or lower bound!"""	)
       if high < low:
              return -1
       if sequence[low] == target:
              return low
       if sequence[high] == target:
              return high
       return rec_linear_search(lowerCAmelCase_ ,     low + 1 ,     high - 1 ,     lowerCAmelCase_	)


if __name__ == "__main__":
   A_							:				Dict						=			input("""Enter numbers separated by comma:\n""").strip()
   A_							:				Any						=			[int(item.strip()) for item in user_input.split(""",""")]

   A_							:				Union[str, Any]						=			int(input("""Enter a single number to be found in the list:\n""").strip())
   A_							:				Dict						=			linear_search(sequence, target)
   if result != -1:
      print(f"""linear_search({sequence}, {target}) = {result}""")
   else:
      print(f"""{target} was not found in {sequence}""")








'''simple docstring'''






def 					snake_case_      (  lowerCAmelCase_	)->	tuple[int, int]:





       '''simple docstring'''


       if len(lowerCAmelCase_	) == 1:
              return a[0], a[0]
       else:
              # split A into half.
              _UpperCAmelCase						:		Union[str, Any]      =				a[: len(lowerCAmelCase_	) // 2]
              _UpperCAmelCase						:		str      =				a[len(lowerCAmelCase_	) // 2 :]

              # 2 sub problems, 1/2 of original size.
              _UpperCAmelCase  ,_UpperCAmelCase						:		str      =				max_difference(lowerCAmelCase_	)
              _UpperCAmelCase  ,_UpperCAmelCase						:		List[str]      =				max_difference(lowerCAmelCase_	)

              # get min of first and max of second
              # linear time
              _UpperCAmelCase						:		Dict      =				min(lowerCAmelCase_	)
              _UpperCAmelCase						:		List[Any]      =				max(lowerCAmelCase_	)

              # 3 cases, either (small1, big1),
              # (min_first, max_second), (small2, big2)
              # constant comparisons
              if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
                     return smalla, biga
              elif biga - smalla > max_second - min_first:
                     return smalla, biga
              else:
                     return min_first, max_second


if __name__ == "__main__":
   import doctest

   doctest.testmod()



