
'''simple docstring'''







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			Optional[int]:
	# if the collection is empty, returns empty
	if collection == []:
		return []

	# get some information about the collection
	_snake_case     		=	len(__A			)
	_snake_case     		=	max(__A			)
	_snake_case     		=	min(__A			)

	# create the counting array
	_snake_case     		=	coll_max + 1 - coll_min
	_snake_case     		=	[0] * counting_arr_length

	# count how much a number appears in the collection
	for number in collection:
		counting_arr[number - coll_min] += 1

	# sum each position with it's predecessors. now, counting_arr[i] tells
	# us how many elements <= i has in the collection
	for i in range(1    ,       __A			):
		_snake_case     		=	counting_arr[i] + counting_arr[i - 1]

	# create the output collection
	_snake_case     		=	[0] * coll_len

	# place the elements in the output, respecting the original order (stable
	# sort) from end to begin, updating counting_arr
	for i in reversed(range(0    ,       __A			)			):
		_snake_case     		=	collection[i]
		counting_arr[collection[i] - coll_min] -= 1

	return ordered







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			List[Any]:
	return "".join([chr(__A			) for i in counting_sort([ord(__A			) for c in string]			)]			)


if __name__ == "__main__":
					# Test string sort
					assert counting_sort_string("thisisthestring") == "eghhiiinrsssttt"

					lowercase					:							str   =      input("Enter numbers separated by a comma:\n").strip()
					lowercase					:							Tuple   =      [int(item) for item in user_input.split(",")]
					print(counting_sort(unsorted))



'''simple docstring'''







from typing import Any

import numpy as np







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			bool:
	return np.array_equal(__A    ,       matrix.conjugate().T			)







def        SCREAMING_SNAKE_CASE__			(     __A    ,       __A			) ->			Any:
	_snake_case     		=	v.conjugate().T
	_snake_case     		=	v_star.dot(__A			)
	assert isinstance(__A    ,       np.ndarray			)
	return (v_star_dot.dot(__A			)) / (v_star.dot(__A			))







def        SCREAMING_SNAKE_CASE__			(     ) ->			None:
	_snake_case     		=	np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]			)
	_snake_case     		=	np.array([[1], [2], [3]]			)
	assert is_hermitian(__A			), F'{a} is not hermitian.'
	print(rayleigh_quotient(__A    ,       __A			)			)

	_snake_case     		=	np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]			)
	assert is_hermitian(__A			), F'{a} is not hermitian.'
	assert rayleigh_quotient(__A    ,       __A			) == float(3			)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					tests()

