

import qiskit



def       __lowerCAmelCase      (						A       ,     A    ):
	UpperCAmelCase_       				=			qiskit.Aer.get_backend("aer_simulator"    )

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

	# Apply X (NOT) Gate to Qubits 0 & 1
	circuit.x(0    )
	circuit.x(1    )

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

	# Execute the circuit on the qasm simulator
	UpperCAmelCase_       				=			qiskit.execute(A       ,     A       ,     shots=1000    )

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


if __name__ == "__main__":
				_a:    List[str] 							=			single_qubit_measure(2, 2)
				print(F'Total count for various states are: {counts}')


from __future__ import annotations

class 						__UpperCamelCase    :




	def __init__(		self	:						Optional[Any]		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







		UpperCAmelCase_				,   UpperCAmelCase_       				=			text, pattern
		UpperCAmelCase_				,   UpperCAmelCase_       				=			len(lowerCAmelCase							), len(lowerCAmelCase							)




	def       __A					(		self	:						List[str]		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







		for i in range(self.patLen - 1		,	-1		,	-1							):
			if char == self.pattern[i]:
				return i
		return -1




	def       __A					(		self	:						int		,	lowerCAmelCase	:						int							):


		'''simple docstring'''







		for i in range(self.patLen - 1		,	-1		,	-1							):
			if self.pattern[i] != self.text[current_pos + i]:
				return current_pos + i
		return -1




	def       __A					(		self	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			[]
		for i in range(self.textLen - self.patLen + 1							):
			UpperCAmelCase_       				=			self.mismatch_in_text(lowerCAmelCase							)
			if mismatch_index == -1:
				positions.append(lowerCAmelCase							)
			else:
				UpperCAmelCase_       				=			self.match_in_pattern(self.text[mismatch_index]							)
				UpperCAmelCase_       				=			(
				    mismatch_index - match_index
				)  # shifting index lgtm [py/multiple-definition]
		return positions


_a:    Dict 							=			"""ABAABA"""
_a:    Union[str, Any] 							=			"""AB"""
_a:    str 							=			BoyerMooreSearch(text, pattern)
_a:    Dict 							=			bms.bad_character_heuristic()

if len(positions) == 0:
				print("""No match found""")
else:
				print("""Pattern found in following positions: """)
				print(positions)