





class       __A					:

			'''simple docstring'''







			def __init__(					self							):



				'''simple docstring'''







				lowerCamelCase__              =	''''''
				lowerCamelCase__              =	''''''
				lowerCamelCase__              =	[]





			def 	__lowerCamelCase       (					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''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]:
						lowerCamelCase__              =	self.__min_dist_top_down_dp(m - 1 ,						n - 1							)
					else:
						lowerCamelCase__              =	self.__min_dist_top_down_dp(__lowerCAmelCase ,						n - 1							)
						lowerCamelCase__              =	self.__min_dist_top_down_dp(m - 1 ,						__lowerCAmelCase							)
						lowerCamelCase__              =	self.__min_dist_top_down_dp(m - 1 ,						n - 1							)
						lowerCamelCase__              =	1 + min(__lowerCAmelCase ,						__lowerCAmelCase ,						__lowerCAmelCase							)

					return self.dp[m][n]





			def 	__lowerCamelCase       (					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__              =	worda
				lowerCamelCase__              =	worda
				lowerCamelCase__              =	[[-1 for _ in range(len(__lowerCAmelCase							)							)] for _ in range(len(__lowerCAmelCase							)							)]

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





			def 	__lowerCamelCase       (					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__              =	worda
				lowerCamelCase__              =	worda
				lowerCamelCase__              =	len(__lowerCAmelCase							)
				lowerCamelCase__              =	len(__lowerCAmelCase							)
				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(__lowerCAmelCase ,						__lowerCAmelCase ,						__lowerCAmelCase							)
				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 ***************")










from __future__ import annotations





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case							)       ->   float:







	'''simple docstring'''







	if days_between_payments <= 0:
		raise ValueError('''days_between_payments must be > 0'''							)
	if daily_interest_rate < 0:
		raise ValueError('''daily_interest_rate must be >= 0'''							)
	if principal <= 0:
		raise ValueError('''principal must be > 0'''							)
	return principal * daily_interest_rate * days_between_payments





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case ,)       ->   float:







	'''simple docstring'''







	if number_of_compounding_periods <= 0:
		raise ValueError('''number_of_compounding_periods must be > 0'''							)
	if nominal_annual_interest_rate_percentage < 0:
		raise ValueError('''nominal_annual_interest_rate_percentage must be >= 0'''							)
	if principal <= 0:
		raise ValueError('''principal must be > 0'''							)

	return principal * (
	    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
	    - 1
	)





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case ,)       ->   float:







	'''simple docstring'''







	if number_of_years <= 0:
		raise ValueError('''number_of_years must be > 0'''							)
	if nominal_annual_percentage_rate < 0:
		raise ValueError('''nominal_annual_percentage_rate must be >= 0'''							)
	if principal <= 0:
		raise ValueError('''principal must be > 0'''							)

	return compound_interest(
	    __snake_case ,nominal_annual_percentage_rate / 365 ,number_of_years * 365							)


if __name__ == "__main__":
			import doctest

			doctest.testmod()



