

from typing import Any

import numpy as np

def 		UpperCamelCase      (lowercase_:				Dict      )  ->   bool:
	return np.array_equal(__snake_case					,   matrix.conjugate().T      )

def 		UpperCamelCase      (lowercase_:				Any					,   lowercase_:				Optional[Any]      )  ->   Any:
	A__							:					Optional[int]       =	v.conjugate().T
	A__							:					Any       =	v_star.dot(__snake_case      )
	assert isinstance(__snake_case					,   np.ndarray      )
	return (v_star_dot.dot(__snake_case      )) / (v_star.dot(__snake_case      ))

def 		UpperCamelCase      ()  ->   None:
	A__							:					Tuple       =	np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]      )
	A__							:					Tuple       =	np.array([[1], [2], [3]]      )
	assert is_hermitian(__snake_case      ), f"""{a} is not hermitian."""
	print(rayleigh_quotient(__snake_case					,   __snake_case      )      )

	A__							:					str       =	np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]      )
	assert is_hermitian(__snake_case      ), f"""{a} is not hermitian."""
	assert rayleigh_quotient(__snake_case					,   __snake_case      ) == float(3      )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	tests()


class 					_a		:


					'''simple docstring'''






					def __init__(				self    ):
						A__							:					str       =	""""""
						A__							:					Any       =	""""""
						A__							:					List[Any]       =	[]






					def 						__A    (				self					, A__					, A__    ):
						if m == -1:
							return n + 1
						elif n == -1:
							return m + 1
						elif self.dp[m][n] > -1:
							return self.dp[m][n]
						else:
							if self.worda[m] == self.worda[n]:
								A__							:					Optional[Any]       =	self.__min_dist_top_down_dp(m - 1					, n - 1    )
							else:
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(A__					, n - 1    )
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(m - 1					, A__    )
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(m - 1					, n - 1    )
								A__							:					List[Any]       =	1 + min(A__					, A__					, A__    )

							return self.dp[m][n]






					def 						__A    (				self					, A__					, A__    ):
						A__							:					Tuple       =	worda
						A__							:					Dict       =	worda
						A__							:					Optional[Any]       =	[[-1 for _ in range(len(A__    )    )] for _ in range(len(A__    )    )]

						return self.__min_dist_top_down_dp(len(A__    ) - 1					, len(A__    ) - 1    )






					def 						__A    (				self					, A__					, A__    ):
						A__							:					Optional[Any]       =	worda
						A__							:					Dict       =	worda
						A__							:					Union[str, Any]       =	len(A__    )
						A__							:					List[str]       =	len(A__    )
						A__							:					int       =	[[0 for _ in range(n + 1    )] for _ in range(m + 1    )]

						for i in range(m + 1    ):
							for j in range(n + 1    ):
								if i == 0:  # first string is empty
									A__							:					Tuple       =	j
								elif j == 0:  # second string is empty
									A__							:					Dict       =	i
								elif worda[i - 1] == worda[j - 1]:  # last characters are equal
									A__							:					str       =	self.dp[i - 1][j - 1]
								else:
									A__							:					Union[str, Any]       =	self.dp[i][j - 1]
									A__							:					str       =	self.dp[i - 1][j]
									A__							:					Union[str, Any]       =	self.dp[i - 1][j - 1]
									A__							:					Tuple       =	1 + min(A__					, A__					, A__    )
						return self.dp[m][n]


if __name__ == "__main__":
	A_ :				Union[str, Any]						 =    EditDistance()

	print('****************** Testing Edit Distance DP Algorithm ******************')
	print()

	A_ :				int						 =    input('Enter the first string: ').strip()
	A_ :				List[str]						 =    input('Enter the second string: ').strip()

	print()
	print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
	print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
	print()
	print('*************** End of Testing Edit Distance DP Algorithm ***************')



