




'''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 ***************')






import math




def 	_SCREAMING_SNAKE_CASE					(		)					->    None:






							'''simple docstring'''





							__UpperCamelCase	:   List[Any]			   =					input("Enter message: ")
							__UpperCamelCase	:   Optional[int]			   =					int(input(F'Enter key [2-{len(_lowerCamelCase) - 1}]: '))
							__UpperCamelCase	:   str			   =					input("Encryption/Decryption [e/d]: ")

							if mode.lower().startswith("e"):
														__UpperCamelCase	:   List[str]			   =					encrypt_message(_lowerCamelCase						,  _lowerCamelCase)
							elif mode.lower().startswith("d"):
														__UpperCamelCase	:   Dict			   =					decrypt_message(_lowerCamelCase						,  _lowerCamelCase)

							# Append pipe symbol (vertical bar) to identify spaces at the end.
							print(F'Output:\n{text + "|"}')




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			int						,  _lowerCamelCase :			str)					->    str:






							'''simple docstring'''





							__UpperCamelCase	:   Optional[Any]			   =					[""] * key
							for col in range(_lowerCamelCase):
														__UpperCamelCase	:   Any			   =					col
														while pointer < len(_lowerCamelCase):
																					cipher_text[col] += message[pointer]
																					pointer += key
							return "".join(_lowerCamelCase)




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			int						,  _lowerCamelCase :			str)					->    str:






							'''simple docstring'''





							__UpperCamelCase	:   Any			   =					math.ceil(len(_lowerCamelCase) / key)
							__UpperCamelCase	:   Any			   =					key
							__UpperCamelCase	:   str			   =					(num_cols * num_rows) - len(_lowerCamelCase)
							__UpperCamelCase	:   Union[str, Any]			   =					[""] * num_cols
							__UpperCamelCase	:   Dict			   =					0
							__UpperCamelCase	:   int			   =					0

							for symbol in message:
														plain_text[col] += symbol
														col += 1

														if (
														    (col == num_cols)
														    or (col == num_cols - 1)
														    and (row >= num_rows - num_shaded_boxes)
														):
																					__UpperCamelCase	:   List[Any]			   =					0
																					row += 1

							return "".join(_lowerCamelCase)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()