
def 							__A(lowerCAmelCase						,  lowerCAmelCase )		->				bool:

		"""simple docstring"""






		_UpperCamelCase						    =	len(lowerCAmelCase ) + 1
		_UpperCamelCase						    =	len(lowerCAmelCase ) + 1

		# dp is a 2d matrix where dp[i][j] denotes whether prefix string of
		# length i of input_string matches with prefix string of length j of
		# given pattern.
		# "dp" stands for dynamic programming.
		_UpperCamelCase						    =	[[0 for i in range(lowerCAmelCase )] for j in range(lowerCAmelCase )]

		# since string of zero length match pattern of zero length
		_UpperCamelCase						    =	1

		# since pattern of zero length will never match with string of non-zero length
		for i in range(1						,  lowerCAmelCase ):
				_UpperCamelCase						    =	0

		# since string of zero length will match with pattern where there
		# is at least one * alternatively
		for j in range(1						,  lowerCAmelCase ):
				_UpperCamelCase						    =	dp[0][j - 2] if pattern[j - 1] == """*""" else 0

		# now using bottom-up approach to find for all remaining lengths
		for i in range(1						,  lowerCAmelCase ):
				for j in range(1						,  lowerCAmelCase ):
						if input_string[i - 1] == pattern[j - 1] or pattern[j - 1] == ".":
								_UpperCamelCase						    =	dp[i - 1][j - 1]

						elif pattern[j - 1] == "*":
								if dp[i][j - 2] == 1:
										_UpperCamelCase						    =	1
								elif pattern[j - 2] in (input_string[i - 1], "."):
										_UpperCamelCase						    =	dp[i - 1][j]
								else:
										_UpperCamelCase						    =	0
						else:
								_UpperCamelCase						    =	0

		return bool(dp[-1][-1] )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		# inputing the strings
		# input_string = input("input a string :")
		# pattern = input("input a pattern :")

		lowerCamelCase__	=							"aab"
		lowerCamelCase__	=							"c*a*b"

		# using function to check whether given string matches the given pattern
		if match_pattern(input_string, pattern):
				print(F"""{input_string} matches the given pattern {pattern}""")
		else:
				print(F"""{input_string} does not match with the given pattern {pattern}""")







from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403


def 							__A(lowerCAmelCase						,  lowerCAmelCase						,  lowerCAmelCase = "x"						,  lowerCAmelCase = 1_0**-1_0						,  lowerCAmelCase = 1						,  )		->				complex:

		"""simple docstring"""






		_UpperCamelCase						    =	symbols(lowerCAmelCase )
		_UpperCamelCase						    =	lambdify(lowerCAmelCase						,  lowerCAmelCase )
		_UpperCamelCase						    =	lambdify(lowerCAmelCase						,  diff(lowerCAmelCase						,  lowerCAmelCase ) )

		_UpperCamelCase						    =	starting_point

		while True:
				if diff_function(lowerCAmelCase ) != 0:
						_UpperCamelCase						    =	prev_guess - multiplicity * func(lowerCAmelCase ) / diff_function(
						    lowerCAmelCase )
				else:
						raise ZeroDivisionError("""Could not find root""" ) from None

				# Precision is checked by comparing the difference of consecutive guesses
				if abs(next_guess - prev_guess ) < precision:
						return next_guess

				_UpperCamelCase						    =	next_guess


# Let's Execute
if __name__ == "__main__":
		# Find root of trigonometric function
		# Find value of pi
		print(F"""The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}""")

		# Find root of polynomial
		# Find fourth Root of 5
		print(F"""The root of x**4 - 5 = 0 is {newton_raphson("x**4 -5", 0.4 +5J)}""")

		# Find value of e
		print(
		    "The root of log(y) - 1 = 0 is ",
		    F"""{newton_raphson("log(y) - 1", 2, variable="y")}""",
		)

		# Exponential Roots
		print(
		    "The root of exp(x) - 1 = 0 is",
		    F"""{newton_raphson("exp(x) - 1", 10, precision=0.0_05)}""",
		)

		# Find root of cos(x)
		print(F"""The root of cos(x) = 0 is {newton_raphson("cos(x)", 0)}""")



