def 				UpperCAmelCase						(    lowercase							,			lowercase							):







				"""simple docstring"""



				__lowercase 			=							0
				__lowercase 			=							len(lowercase							) - 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

								__lowercase 			=							left + ((item - sorted_collection[left]) * (right - left)) // (
								    sorted_collection[right] - sorted_collection[left]
								)

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

								__lowercase 			=							sorted_collection[point]
								if current_item == item:
												return point
								else:
												if point < left:
																__lowercase 			=							left
																__lowercase 			=							point
												elif point > right:
																__lowercase 			=							right
																__lowercase 			=							point
												else:
																if item < current_item:
																				__lowercase 			=							point - 1
																else:
																				__lowercase 			=							point + 1
				return None





def 				UpperCAmelCase						(    lowercase							,			lowercase							,			lowercase							,			lowercase							):







				"""simple docstring"""



				if sorted_collection[left] == sorted_collection[right]:
								if sorted_collection[left] == item:
												return left
								else:
												return None

				__lowercase 			=							left + ((item - sorted_collection[left]) * (right - left)) // (
				    sorted_collection[right] - sorted_collection[left]
				)

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

				if sorted_collection[point] == item:
								return point
				elif point < left:
								return interpolation_search_by_recursion(lowercase							,			lowercase							,			lowercase							,			lowercase							)
				elif point > right:
								return interpolation_search_by_recursion(lowercase							,			lowercase							,			lowercase							,			lowercase							)
				else:
								if sorted_collection[point] > item:
												return interpolation_search_by_recursion(
												    lowercase							,			lowercase							,			lowercase							,			point - 1							)
								else:
												return interpolation_search_by_recursion(
												    lowercase							,			lowercase							,			point + 1							,			lowercase							)





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



				if collection != sorted(lowercase							):
								raise ValueError('''Collection must be ascending sorted'''							)
				return True


if __name__ == "__main__":
		import sys
		__a  :     str       =  0
		if debug == 1:
				__a  :     str       =  [1_0, 3_0, 4_0, 4_5, 5_0, 6_6, 7_7, 9_3]
				try:
						__assert_sorted(collection)
				except ValueError:
						sys.exit("""Sequence must be ascending sorted to apply interpolation search""")
				__a  :     Optional[int]       =  6_7

		__a  :     Union[str, Any]       =  interpolation_search(collection, target)
		if result is not None:
				print(F'''{target} found at positions: {result}''')
		else:
				print("""Not found""")
import qiskit





def 				UpperCAmelCase						(    lowercase							,			lowercase							):







				"""simple docstring"""



				__lowercase 			=							qiskit.Aer.get_backend('''aer_simulator'''							)

				# Create a Quantum Circuit acting on the q register
				__lowercase 			=							qiskit.QuantumCircuit(lowercase							,			lowercase							)

				# Map the quantum measurement to the classical bits
				circuit.measure([0]							,			[0]							)

				# Execute the circuit on the simulator
				__lowercase 			=							qiskit.execute(lowercase							,			lowercase							,			shots=1000							)

				# Return the histogram data of the results of the experiment.
				return job.result().get_counts(lowercase							)


if __name__ == "__main__":
		print(F'''Total count for various states are: {single_qubit_measure(1, 1)}''')