






'''simple docstring'''

class 							__magic_name__     :







	"""simple docstring"""



	def __init__(							self       )						->  Optional[int]:
							lowercase_      :   Any        =			''
							lowercase_      :   Union[str, Any]        =			''
							lowercase_      :   Any        =			[]
	def        lowerCamelCase__		(							self  ,      _lowercase  ,      _lowercase       )						->  int:





							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]:
																			lowercase_      :   List[str]        =			self.__min_dist_top_down_dp(m - 1  ,      n - 1       )
													else:
																			lowercase_      :   str        =			self.__min_dist_top_down_dp(_lowerCamelCase  ,      n - 1       )
																			lowercase_      :   List[Any]        =			self.__min_dist_top_down_dp(m - 1  ,      _lowerCamelCase       )
																			lowercase_      :   str        =			self.__min_dist_top_down_dp(m - 1  ,      n - 1       )
																			lowercase_      :   Any        =			1 + min(_lowerCamelCase  ,      _lowerCamelCase  ,      _lowerCamelCase       )

													return self.dp[m][n]
	def        lowerCamelCase__		(							self  ,      _lowercase  ,      _lowercase       )						->  int:
							lowercase_      :   int        =			worda
							lowercase_      :   Optional[int]        =			worda
							lowercase_      :   Dict        =			[[-1 for _ in range(len(_lowerCamelCase       )       )] for _ in range(len(_lowerCamelCase       )       )]

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







	def        lowerCamelCase__		(							self  ,      _lowercase  ,      _lowercase       )						->  int:
							lowercase_      :   str        =			worda
							lowercase_      :   Any        =			worda
							lowercase_      :   str        =			len(_lowerCamelCase       )
							lowercase_      :   int        =			len(_lowerCamelCase       )
							lowercase_      :   Union[str, Any]        =			[[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
																									lowercase_      :   Optional[int]        =			j
																			elif j == 0:  # second string is empty
																									lowercase_      :   Optional[int]        =			i
																			elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																									lowercase_      :   Tuple        =			self.dp[i - 1][j - 1]
																			else:
																									lowercase_      :   Union[str, Any]        =			self.dp[i][j - 1]
																									lowercase_      :   List[str]        =			self.dp[i - 1][j]
																									lowercase_      :   List[Any]        =			self.dp[i - 1][j - 1]
																									lowercase_      :   Tuple        =			1 + min(_lowerCamelCase  ,      _lowerCamelCase  ,      _lowerCamelCase       )
							return self.dp[m][n]


if __name__ == "__main__":
						A:      List[Any]  				=				EditDistance()

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

						A:      Optional[Any]  				=				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 ***************")








'''simple docstring'''

from ..utils import DummyObject, requires_backends






class 							__magic_name__     (	metaclass=UpperCAmelCase_				):







	"""simple docstring"""



	SCREAMING_SNAKE_CASE_					:      str        =  ['transformers', 'torch', 'note_seq']
	def __init__(							self  ,      *_lowercase  ,      **_lowercase       )						->  Dict:
							requires_backends(self  ,      ['transformers', 'torch', 'note_seq']       )
	@classmethod
	def        lowerCamelCase__		(							cls  ,      *_lowercase  ,      **_lowercase       )						->  List[str]:
							requires_backends(cls  ,      ['transformers', 'torch', 'note_seq']       )







	@classmethod
	def        lowerCamelCase__		(							cls  ,      *_lowercase  ,      **_lowercase       )						->  Dict:
							requires_backends(cls  ,      ['transformers', 'torch', 'note_seq']       )
