





'''simple docstring'''






def    lowercase_   (		lowercase__					,	lowercase__    ) ->int:
						# The longer word should come first
						if len(lowercase__    ) < len(lowercase__    ):
												return levenshtein_distance(lowercase__					,	lowercase__    )

						if len(lowercase__    ) == 0:
												return len(lowercase__    )

						_snake_case: List[str]	       =		list(range(len(lowercase__    ) + 1    )    )

						for i, ca in enumerate(lowercase__    ):
												_snake_case: str	       =		[i + 1]

												for j, ca in enumerate(lowercase__    ):
																		# Calculate insertions, deletions and substitutions
																		_snake_case: Dict	       =		previous_row[j + 1] + 1
																		_snake_case: Optional[Any]	       =		current_row[j] + 1
																		_snake_case: Optional[int]	       =		previous_row[j] + (ca != ca)

																		# Get the minimum to append to the current row
																		current_row.append(min(lowercase__					,	lowercase__					,	lowercase__    )    )

												# Store the previous row
												_snake_case: List[Any]	       =		current_row

						# Returns the last element (distance)
						return previous_row[-1]


if __name__ == "__main__":
		A :			List[str]							   =      input('Enter the first word:\n').strip()
		A :			str							   =      input('Enter the second word:\n').strip()

		A :			Tuple							   =      levenshtein_distance(first_word, second_word)
		print(F'Levenshtein distance between {first_word} and {second_word} is {result}')












'''simple docstring'''






import math
from collections.abc import Generator





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)    ))
						for i in (n for n in numbers if n > 1):
												for j in range(2					,	lowercase__    ):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)    ))
						for i in (n for n in numbers if n > 1):
												# only need to check for factors up to sqrt(i)
												_snake_case: int	       =		int(math.sqrt(lowercase__    )    ) + 1
												for j in range(2					,	lowercase__    ):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)					,	2    ))
						# It's useless to test even numbers as they will not be prime
						if max_n > 2:
												yield 2  # Because 2 will not be tested, it's necessary to yield it now
						for i in (n for n in numbers if n > 1):
												_snake_case: List[str]	       =		int(math.sqrt(lowercase__    )    ) + 1
												for j in range(3					,	lowercase__					,	2    ):
																		# As we removed the even numbers, we don't need them now
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		) ->Optional[int]:
						from timeit import timeit

						_snake_case: Dict	       =		'from __main__ import slow_primes, primes, fast_primes'
						print(timeit('slow_primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )
						print(timeit('primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )
						print(timeit('fast_primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )


if __name__ == "__main__":
		A :			List[str]							   =      int(input('Calculate primes up to:\n>> ').strip())
		for ret in primes(number):
				print(ret)
		benchmark()





