



'''simple docstring'''





import qiskit






def 			lowerCAmelCase__	(					lowerCamelCase_	:	Optional[int] ,lowerCamelCase_	:	List[Any]):





				'''simple docstring'''

				lowerCAmelCase__  :       Optional[int]				=  qiskit.Aer.get_backend('''aer_simulator''')

				lowerCAmelCase__  :       List[Any]				=  qiskit.QuantumCircuit(4 ,2)
				# encode inputs in qubits 0 and 1
				if bita == 1:
								qc_ha.x(0)
				if bita == 1:
								qc_ha.x(1)
				qc_ha.barrier()

				# use cnots to write XOR of the inputs on qubit2
				qc_ha.cx(0 ,2)
				qc_ha.cx(1 ,2)

				# use ccx / toffoli gate to write AND of the inputs on qubit3
				qc_ha.ccx(0 ,1 ,3)
				qc_ha.barrier()

				# extract outputs
				qc_ha.measure(2 ,0)  # extract XOR value
				qc_ha.measure(3 ,1)  # extract AND value

				# Execute the circuit on the qasm simulator
				lowerCAmelCase__  :       Union[str, Any]				=  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__":
							__snake_case       :	Tuple            =half_adder(1, 1)
							print(f"""Half Adder Output Qubit Counts: {counts}""")






from __future__ import annotations






def 			lowerCAmelCase__	(					lowerCamelCase_	:	int):





				'''simple docstring'''

				lowerCAmelCase__  :       Optional[int]				=  str(lowerCamelCase_)
				return len(lowerCamelCase_) == 9 and set(lowerCamelCase_) == set('''123456789''')






def 			lowerCAmelCase__	(					):





				'''simple docstring'''

				for base_num in range(9999 ,4999 ,-1):
								lowerCAmelCase__  :       Union[str, Any]				=  100002 * base_num
								if is_9_pandigital(lowerCamelCase_):
												return candidate

				for base_num in range(333 ,99 ,-1):
								lowerCAmelCase__  :       Any				=  1002003 * base_num
								if is_9_pandigital(lowerCamelCase_):
												return candidate

				return None


if __name__ == "__main__":
							print(f"""{solution() = }""")

