




'''simple docstring'''







class 			_a  :
       def __init__(	self						:	List[str]				):



           '''simple docstring'''

           UpperCAmelCase			       =		''''''
           UpperCAmelCase			       =		''''''
           UpperCAmelCase			       =		[]
       def     A      (	self						:	List[Any]   ,				lowercase						:	int   ,				lowercase						:	int				):



           '''simple docstring'''

           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]:
                   UpperCAmelCase			       =		self.__min_dist_top_down_dp(m - 1   ,				n - 1				)
               else:
                   UpperCAmelCase			       =		self.__min_dist_top_down_dp(lowercase   ,				n - 1				)
                   UpperCAmelCase			       =		self.__min_dist_top_down_dp(m - 1   ,				lowercase				)
                   UpperCAmelCase			       =		self.__min_dist_top_down_dp(m - 1   ,				n - 1				)
                   UpperCAmelCase			       =		1 + min(lowercase   ,				lowercase   ,				lowercase				)

               return self.dp[m][n]
       def     A      (	self						:	Optional[int]   ,				lowercase						:	str   ,				lowercase						:	str				):



           '''simple docstring'''

           UpperCAmelCase			       =		worda
           UpperCAmelCase			       =		worda
           UpperCAmelCase			       =		[[-1 for _ in range(len(lowercase				)				)] for _ in range(len(lowercase				)				)]

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







       def     A      (	self						:	Union[str, Any]   ,				lowercase						:	str   ,				lowercase						:	str				):



           '''simple docstring'''

           UpperCAmelCase			       =		worda
           UpperCAmelCase			       =		worda
           UpperCAmelCase			       =		len(lowercase				)
           UpperCAmelCase			       =		len(lowercase				)
           UpperCAmelCase			       =		[[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
                       UpperCAmelCase			       =		j
                   elif j == 0:  # second string is empty
                       UpperCAmelCase			       =		i
                   elif worda[i - 1] == worda[j - 1]:  # last characters are equal
                       UpperCAmelCase			       =		self.dp[i - 1][j - 1]
                   else:
                       UpperCAmelCase			       =		self.dp[i][j - 1]
                       UpperCAmelCase			       =		self.dp[i - 1][j]
                       UpperCAmelCase			       =		self.dp[i - 1][j - 1]
                       UpperCAmelCase			       =		1 + min(lowercase   ,				lowercase   ,				lowercase				)
           return self.dp[m][n]


if __name__ == "__main__":
   A     =EditDistance()

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

   A     =input('Enter the first string: ').strip()
   A     =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 			_a  (	metaclass=__a ):
       __a				:     int   				=					["""flax""", """transformers"""]
       def __init__(	self						:	Optional[Any]   ,				*lowercase						:	str   ,				**lowercase						:	List[Any]				):



           '''simple docstring'''

           requires_backends(self   ,				['''flax''', '''transformers''']				)
       @classmethod
       def     A      (	cls						:	Union[str, Any]   ,				*lowercase						:	List[Any]   ,				**lowercase						:	List[str]				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)







       @classmethod
       def     A      (	cls						:	Union[str, Any]   ,				*lowercase						:	Tuple   ,				**lowercase						:	int				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)






class 			_a  (	metaclass=__a ):
       __a				:     int   				=					["""flax""", """transformers"""]
       def __init__(	self						:	int   ,				*lowercase						:	Tuple   ,				**lowercase						:	Dict				):



           '''simple docstring'''

           requires_backends(self   ,				['''flax''', '''transformers''']				)
       @classmethod
       def     A      (	cls						:	List[str]   ,				*lowercase						:	Optional[int]   ,				**lowercase						:	List[Any]				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)







       @classmethod
       def     A      (	cls						:	Dict   ,				*lowercase						:	Union[str, Any]   ,				**lowercase						:	Union[str, Any]				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)






class 			_a  (	metaclass=__a ):
       __a				:     int   				=					["""flax""", """transformers"""]
       def __init__(	self						:	Optional[int]   ,				*lowercase						:	Union[str, Any]   ,				**lowercase						:	Any				):



           '''simple docstring'''

           requires_backends(self   ,				['''flax''', '''transformers''']				)
       @classmethod
       def     A      (	cls						:	Union[str, Any]   ,				*lowercase						:	Tuple   ,				**lowercase						:	Any				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)







       @classmethod
       def     A      (	cls						:	Any   ,				*lowercase						:	Dict   ,				**lowercase						:	Optional[Any]				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)






class 			_a  (	metaclass=__a ):
       __a				:     Any   				=					["""flax""", """transformers"""]
       def __init__(	self						:	Any   ,				*lowercase						:	Optional[Any]   ,				**lowercase						:	Optional[int]				):



           '''simple docstring'''

           requires_backends(self   ,				['''flax''', '''transformers''']				)
       @classmethod
       def     A      (	cls						:	Dict   ,				*lowercase						:	Optional[Any]   ,				**lowercase						:	Optional[Any]				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)







       @classmethod
       def     A      (	cls						:	Union[str, Any]   ,				*lowercase						:	str   ,				**lowercase						:	Any				):



           '''simple docstring'''

           requires_backends(cls   ,				['''flax''', '''transformers''']				)




