"""simple docstring"""




class 						__A							:






     def __init__(		self  ):
       _lowerCAmelCase						:	Dict        =					""""""
       _lowerCAmelCase						:	Optional[Any]        =					""""""
       _lowerCAmelCase						:	Optional[int]        =					[]






     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]:
           _lowerCAmelCase						:	List[str]        =					self.__min_dist_top_down_dp(m - 1    ,					n - 1  )
         else:
           _lowerCAmelCase						:	Optional[int]        =					self.__min_dist_top_down_dp(a__    ,					n - 1  )
           _lowerCAmelCase						:	str        =					self.__min_dist_top_down_dp(m - 1    ,					a__  )
           _lowerCAmelCase						:	Any        =					self.__min_dist_top_down_dp(m - 1    ,					n - 1  )
           _lowerCAmelCase						:	Dict        =					1 + min(a__    ,					a__    ,					a__  )

         return self.dp[m][n]






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


if __name__ == "__main__":
     _a				:		Any	   =       EditDistance()

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

     _a				:		Tuple	   =       input('Enter the first string: ').strip()
     _a				:		Tuple	   =       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 							SCREAMING_SNAKE_CASE					(      _lowerCamelCase						:	list     )	->				float:
  if not nums:
    raise ValueError("""List is empty"""     )
  return sum(_lowerCamelCase     ) / len(_lowerCamelCase     )


if __name__ == "__main__":
     import doctest

     doctest.testmod()




