





'''simple docstring'''

from collections.abc import Sequence





def 						UpperCamelCase    (							_lowerCamelCase : Sequence[float]						,	_lowerCamelCase : bool = False	):
    if not arr:
        return 0

    A__    =      0 if allow_empty_subarrays else float("-inf"	)
    A__    =      0.0
    for num in arr:
        A__    =      max(0 if allow_empty_subarrays else num						,	curr_sum + num	)
        A__    =      max(_lowerCamelCase						,	_lowerCamelCase	)

    return max_sum


if __name__ == "__main__":
  from doctest import testmod

  testmod()

  __lowerCAmelCase							:     Union[str, Any]		     =[-2, 1, -3, 4, -1, 2, 1, -5, 4]
  print(f"""{max_subarray_sum(nums) = }""")










'''simple docstring'''

import qiskit





def 						UpperCamelCase    (							_lowerCamelCase : int						,	_lowerCamelCase : int	):
    A__    =      qiskit.Aer.get_backend("aer_simulator"	)

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

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

    # Execute the circuit on the simulator
    A__    =      qiskit.execute(_lowerCamelCase						,	_lowerCamelCase						,	shots=10_00	)

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


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



