
class 						__lowerCAmelCase	:



      """simple docstring"""







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




      def 		snake_case_			(      self		:       Optional[int]				,       _snake_case		:       Tuple				,       _snake_case		:       Tuple				):
          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		:			int	    =       self.__min_dist_top_down_dp(m - 1				,       n - 1				)
              else:
                  __lowercase		:			Tuple	    =       self.__min_dist_top_down_dp(_snake_case				,       n - 1				)
                  __lowercase		:			str	    =       self.__min_dist_top_down_dp(m - 1				,       _snake_case				)
                  __lowercase		:			List[Any]	    =       self.__min_dist_top_down_dp(m - 1				,       n - 1				)
                  __lowercase		:			Optional[int]	    =       1 + min(_snake_case				,       _snake_case				,       _snake_case				)

              return self.dp[m][n]




      def 		snake_case_			(      self		:       Optional[int]				,       _snake_case		:       Dict				,       _snake_case		:       str				):
          __lowercase		:			List[Any]	    =       worda
          __lowercase		:			int	    =       worda
          __lowercase		:			str	    =       [[-1 for _ in range(len(_snake_case				)				)] for _ in range(len(_snake_case				)				)]

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




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


if __name__ == "__main__":
 __lowerCAmelCase					:			Optional[Any]			      =		EditDistance()

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

 __lowerCAmelCase					:			Optional[Any]			      =		input("Enter the first string: ").strip()
 __lowerCAmelCase					:			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 ***************")




__lowerCAmelCase					:			Dict			      =		"\n# Installazione di Transformers\n! pip install transformers datasets\n# Per installare dalla fonte invece dell'ultima versione rilasciata, commenta il comando sopra e\n# rimuovi la modalità commento al comando seguente.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

__lowerCAmelCase					:			Tuple			      =		[{"type": "code", "content": INSTALL_CONTENT}]
__lowerCAmelCase					:			List[Any]			      =		{
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}


