






"""simple docstring"""



import os

# Precomputes a list of the 100 first triangular numbers
__A		:       int  				=		[int(0.5 * n * (n + 1)) for n in range(1, 101)]



def 						lowercase    (				):
		lowercase_ : Optional[Any]							       =   os.path.dirname(os.path.realpath(__snake_case	)	)
		lowercase_ : int							       =   os.path.join(__snake_case		,					'''words.txt'''	)

		lowercase_ : Tuple							       =   ''''''
		with open(__snake_case	) as f:
				lowercase_ : Union[str, Any]							       =   f.readline()

		lowercase_ : Any							       =   [word.strip('''"'''	) for word in words.strip('''\r\n'''	).split(''','''	)]
		lowercase_ : Optional[int]							       =   [
		    word
		    for word in [sum(ord(__snake_case	) - 6_4 for x in word	) for word in words]
		    if word in TRIANGULAR_NUMBERS
		]
		return len(__snake_case	)


if __name__ == "__main__":
						print(solution())










"""simple docstring"""




import qiskit





def 						UpperCAmelCase__		(     _UpperCAmelCase ,					_UpperCAmelCase					):






  """simple docstring"""





  A_  :       Tuple										=  qiskit.Aer.get_backend('aer_simulator'					)

  A_  :       str										=  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
  A_  :       Optional[Any]										=  qiskit.execute(_UpperCAmelCase ,					_UpperCAmelCase ,					shots=1000					)

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


if __name__ == "__main__":
   lowerCamelCase_     :						List[str]						=					half_adder(1, 1)
   print(F"Half Adder Output Qubit Counts: {counts}")