



def 		UpperCamelCase     (       snake_case__	:   List[Any]	,					snake_case__	:   str     )     ->					Dict:
   UpperCamelCase   :  Optional[Any]						     =     0
   UpperCamelCase   :  List[str]						     =     len(snake_case__     ) - 1

   while left <= right:
      # avoid divided by 0 during interpolation
      if sorted_collection[left] == sorted_collection[right]:
         if sorted_collection[left] == item:
            return left
         else:
            return None

      UpperCamelCase   :  str						     =     left + ((item - sorted_collection[left]) * (right - left)) // (
          sorted_collection[right] - sorted_collection[left]
      )

      # out of range check
      if point < 0 or point >= len(snake_case__     ):
         return None

      UpperCamelCase   :  Tuple						     =     sorted_collection[point]
      if current_item == item:
         return point
      else:
         if point < left:
            UpperCamelCase   :  Any						     =     left
            UpperCamelCase   :  Optional[int]						     =     point
         elif point > right:
            UpperCamelCase   :  str						     =     right
            UpperCamelCase   :  Tuple						     =     point
         else:
            if item < current_item:
               UpperCamelCase   :  Union[str, Any]						     =     point - 1
            else:
               UpperCamelCase   :  List[str]						     =     point + 1
   return None
def 		UpperCamelCase     (       snake_case__	:   Optional[Any]	,					snake_case__	:   Union[str, Any]	,					snake_case__	:   Tuple	,					snake_case__	:   Tuple     )     ->					Union[str, Any]:

   # avoid divided by 0 during interpolation
   if sorted_collection[left] == sorted_collection[right]:
      if sorted_collection[left] == item:
         return left
      else:
         return None

   UpperCamelCase   :  Optional[int]						     =     left + ((item - sorted_collection[left]) * (right - left)) // (
       sorted_collection[right] - sorted_collection[left]
   )

   # out of range check
   if point < 0 or point >= len(snake_case__     ):
      return None

   if sorted_collection[point] == item:
      return point
   elif point < left:
      return interpolation_search_by_recursion(snake_case__	,					snake_case__	,					snake_case__	,					snake_case__     )
   elif point > right:
      return interpolation_search_by_recursion(snake_case__	,					snake_case__	,					snake_case__	,					snake_case__     )
   else:
      if sorted_collection[point] > item:
         return interpolation_search_by_recursion(
             snake_case__	,					snake_case__	,					snake_case__	,					point - 1     )
      else:
         return interpolation_search_by_recursion(
             snake_case__	,					snake_case__	,					point + 1	,					snake_case__     )
def 		UpperCamelCase     (       snake_case__	:   str     )     ->					int:
   if collection != sorted(snake_case__     ):
      raise ValueError('Collection must be ascending sorted'     )
   return True


if __name__ == "__main__":
    import sys
    __UpperCAmelCase	       =	0
    if debug == 1:
        __UpperCAmelCase	       =	[10, 30, 40, 45, 50, 66, 77, 93]
        try:
            __assert_sorted(collection)
        except ValueError:
            sys.exit('''Sequence must be ascending sorted to apply interpolation search''')
        __UpperCAmelCase	       =	67

    __UpperCAmelCase	       =	interpolation_search(collection, target)
    if result is not None:
        print(F"""{target} found at positions: {result}""")
    else:
        print('''Not found''')









import re
def 		UpperCamelCase     (       snake_case__	:   str     )     ->					str:

   if len(re.findall('[ATCG]'	,					snake_case__     )     ) != len(snake_case__     ):
      raise ValueError('Invalid Strand'     )

   return dna.translate(dna.maketrans('ATCG'	,					'TAGC'     )     )


if __name__ == "__main__":
    import doctest

    doctest.testmod()



