






'''simple docstring'''

class        a_		:

  def __init__(   self   )						->   Tuple:



        """simple docstring"""






        UpperCamelCase       						=      """"""
        UpperCamelCase       						=      """"""
        UpperCamelCase       						=      []

  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )						->   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(_SCREAMING_SNAKE_CASE    ,	n - 1   )
                    UpperCamelCase       						=      self.__min_dist_top_down_dp(m - 1    ,	_SCREAMING_SNAKE_CASE   )
                    UpperCamelCase       						=      self.__min_dist_top_down_dp(m - 1    ,	n - 1   )
                    UpperCamelCase       						=      1 + min(_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )

              return self.dp[m][n]

  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )						->   int:



        """simple docstring"""






        UpperCamelCase       						=      worda
        UpperCamelCase       						=      worda
        UpperCamelCase       						=      [[-1 for _ in range(len(_SCREAMING_SNAKE_CASE   )   )] for _ in range(len(_SCREAMING_SNAKE_CASE   )   )]

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


  def 						A__		(   self    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )						->   int:



        """simple docstring"""






        UpperCamelCase       						=      worda
        UpperCamelCase       						=      worda
        UpperCamelCase       						=      len(_SCREAMING_SNAKE_CASE   )
        UpperCamelCase       						=      len(_SCREAMING_SNAKE_CASE   )
        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(_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE   )
        return self.dp[m][n]


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

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

     SCREAMING_SNAKE_CASE__											=     input('Enter the first string: ').strip()
     SCREAMING_SNAKE_CASE__											=     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 __future__ import annotations







def 					lowercase__				(   __UpperCamelCase	,		__UpperCamelCase	,		__UpperCamelCase					)->				dict[str, float]:
      if (voltage, current, resistance).count(0					) != 1:
            raise ValueError("""One and only one argument must be 0"""					)
      if resistance < 0:
            raise ValueError("""Resistance cannot be negative"""					)
      if voltage == 0:
            return {"voltage": float(current * resistance					)}
      elif current == 0:
            return {"current": voltage / resistance}
      elif resistance == 0:
            return {"resistance": voltage / current}
      else:
            raise ValueError("""Exactly one argument must be 0"""					)


if __name__ == "__main__":
     import doctest

     doctest.testmod()
