'''simple docstring'''

class   SCREAMING_SNAKE_CASE			:







		"""simple docstring"""






		def __init__(   self				) ->     List[str]:
								_lowerCAmelCase										=''
								_lowerCAmelCase										=''
								_lowerCAmelCase										=[]






		def 		UpperCamelCase__       (   self		,						__A		,						__A				) ->     int:
								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										=self.__min_dist_top_down_dp(m - 1		,						n - 1				)
														else:
																				_lowerCAmelCase										=self.__min_dist_top_down_dp(__A		,						n - 1				)
																				_lowerCAmelCase										=self.__min_dist_top_down_dp(m - 1		,						__A				)
																				_lowerCAmelCase										=self.__min_dist_top_down_dp(m - 1		,						n - 1				)
																				_lowerCAmelCase										=1 + min(__A		,						__A		,						__A				)

														return self.dp[m][n]






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


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

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

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

lowercase_     		= 10



def 							UpperCamelCase__			(			a__      ):


						'''simple docstring'''






						_lowerCAmelCase										=1
						_lowerCAmelCase										=max(a__      )
						while placement <= max_digit:
												# declare and initialize empty buckets
												_lowerCAmelCase										=[[] for _ in range(a__      )]
												# split list_of_ints between the buckets
												for i in list_of_ints:
																		_lowerCAmelCase										=int((i / placement) % RADIX      )
																		buckets[tmp].append(a__      )
												# put each buckets' contents into list_of_ints
												_lowerCAmelCase										=0
												for b in range(a__      ):
																		for i in buckets[b]:
																								_lowerCAmelCase										=i
																								a += 1
        # move to next
												placement *= RADIX
						return list_of_ints


if __name__ == "__main__":
							import doctest

							doctest.testmod()





