






'''simple docstring'''

class       UpperCAmelCase :




		def __init__(self      :	Tuple				)					-> Optional[int]:
						lowercase         = ""
						lowercase         = ""
						lowercase         = []




		def 				UpperCAmelCase__   (self      :	str							,			A__      :	int							,			A__      :	int				)					-> 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]:
														lowercase         = self.__min_dist_top_down_dp(m - 1							,			n - 1				)
										else:
														lowercase         = self.__min_dist_top_down_dp(A__							,			n - 1				)
														lowercase         = self.__min_dist_top_down_dp(m - 1							,			A__				)
														lowercase         = self.__min_dist_top_down_dp(m - 1							,			n - 1				)
														lowercase         = 1 + min(A__							,			A__							,			A__				)

										return self.dp[m][n]




		def 				UpperCAmelCase__   (self      :	Optional[Any]							,			A__      :	str							,			A__      :	str				)					-> int:
						lowercase         = worda
						lowercase         = worda
						lowercase         = [[-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      :	Optional[int]							,			A__      :	str							,			A__      :	str				)					-> int:
						lowercase         = worda
						lowercase         = worda
						lowercase         = len(A__				)
						lowercase         = len(A__				)
						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(A__							,			A__							,			A__				)
						return self.dp[m][n]


if __name__ == "__main__":
			__lowerCamelCase : str											=			EditDistance()

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

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

__lowerCamelCase : str											=			8.314_4598







def 							UpperCAmelCase_    (	lowerCAmelCase_		,							lowerCAmelCase_							):

				"""simple docstring"""






				if temperature < 0:
								raise Exception("Temperature cannot be less than 0 K"							)
				if molar_mass <= 0:
								raise Exception("Molar mass cannot be less than or equal to 0 kg/mol"							)
				else:
								return (3 * UNIVERSAL_GAS_CONSTANT * temperature / molar_mass) ** 0.5


if __name__ == "__main__":
			import doctest

			# run doctest
			doctest.testmod()

			# example
			__lowerCamelCase : Optional[Any]											=			300
			__lowerCamelCase : Tuple											=			28
			__lowerCamelCase : str											=			rms_speed_of_molecule(temperature, molar_mass)
			print(f"Vrms of Nitrogen gas at 300 K is {vrms} m/s")




