


def        SCREAMING_SNAKE_CASE_						(			__A :			Union[str, Any]				)	->		List[str]:

       """simple docstring"""

       if not isinstance(__A  ,    __A				):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'				)
       if len(__A				) == 0:
              raise ValueError('Input list must be a non empty list'				)
       if len(__A				) == 1:
              return True
       a_					:		Optional[Any]							=  series[1] - series[0]
       for index in range(len(__A				) - 1				):
              if series[index + 1] - series[index] != common_diff:
                     return False
       return True







def        SCREAMING_SNAKE_CASE_						(			__A :			Optional[int]				)	->		List[str]:

       """simple docstring"""

       if not isinstance(__A  ,    __A				):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'				)
       if len(__A				) == 0:
              raise ValueError('Input list must be a non empty list'				)
       a_					:		Any							=  0
       for val in series:
              answer += val
       return answer / len(__A				)


if __name__ == "__main__":
   import doctest

   doctest.testmod()






class        _a							:

							def __init__(							self:	Any							)			->   Tuple:





									"""simple docstring"""







									lowercase__            =      ''''''
									lowercase__            =      ''''''
									lowercase__            =      []

							def       lowerCamelCase_ (							self:	Union[str, Any]    ,						UpperCamelCase_:	int    ,						UpperCamelCase_:	int							)			->   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]:
													lowercase__            =      self.__min_dist_top_down_dp(m - 1    ,						n - 1							)
											else:
													lowercase__            =      self.__min_dist_top_down_dp(UpperCamelCase_    ,						n - 1							)
													lowercase__            =      self.__min_dist_top_down_dp(m - 1    ,						UpperCamelCase_							)
													lowercase__            =      self.__min_dist_top_down_dp(m - 1    ,						n - 1							)
													lowercase__            =      1 + min(UpperCamelCase_    ,						UpperCamelCase_    ,						UpperCamelCase_							)

											return self.dp[m][n]

							def       lowerCamelCase_ (							self:	Union[str, Any]    ,						UpperCamelCase_:	str    ,						UpperCamelCase_:	str							)			->   int:





									"""simple docstring"""







									lowercase__            =      worda
									lowercase__            =      worda
									lowercase__            =      [[-1 for _ in range(len(UpperCamelCase_							)							)] for _ in range(len(UpperCamelCase_							)							)]

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


							def       lowerCamelCase_ (							self:	int    ,						UpperCamelCase_:	str    ,						UpperCamelCase_:	str							)			->   int:





									"""simple docstring"""







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


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

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

			lowerCAmelCase       =							input('Enter the first string: ').strip()
			lowerCAmelCase       =							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 ***************')


