
def      _a     (   __UpperCamelCase       :  str	,__UpperCamelCase       :  str    ):
			# The longer word should come first
			if len(__UpperCamelCase    ) < len(__UpperCamelCase    ):
						return levenshtein_distance(__UpperCamelCase	,__UpperCamelCase    )

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

			lowerCAmelCase__ :    int				      =			list(range(len(__UpperCamelCase    ) + 1    )    )

			for i, ca in enumerate(__UpperCamelCase    ):
						lowerCAmelCase__ :    List[str]				      =			[i + 1]

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

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

						# Store the previous row
						lowerCAmelCase__ :    Optional[int]				      =			current_row

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


if __name__ == "__main__":
							A__       :   Union[str, Any]   						=					input("""Enter the first word:\n""").strip()
							A__       :   int   						=					input("""Enter the second word:\n""").strip()

							A__       :   int   						=					levenshtein_distance(first_word, second_word)
							print(f"""Levenshtein distance between {first_word} and {second_word} is {result}""")





import numpy as np
from numpy import floataa
from numpy.typing import NDArray



def      _a     (   __UpperCamelCase       :  NDArray[floataa]	,__UpperCamelCase       :  NDArray[floataa]    ):
			lowerCAmelCase__      ,				lowerCAmelCase__ :    Any				      =			np.shape(__UpperCamelCase    )

			lowerCAmelCase__ :    NDArray[floataa]				      =			np.zeros((rows, 1)	,dtype=__UpperCamelCase    )
			for row in reversed(range(__UpperCamelCase    )    ):
						lowerCAmelCase__ :    List[str]				      =			0
						for col in range(row + 1	,__UpperCamelCase    ):
									total += coefficients[row, col] * x[col]

						lowerCAmelCase__ :    int				      =			(vector[row] - total) / coefficients[row, row]

			return x



def      _a     (   __UpperCamelCase       :  NDArray[floataa]	,__UpperCamelCase       :  NDArray[floataa]    ):
			lowerCAmelCase__      ,				lowerCAmelCase__ :    str				      =			np.shape(__UpperCamelCase    )
			if rows != columns:
						return np.array(()	,dtype=__UpperCamelCase    )

			# augmented matrix
			lowerCAmelCase__ :    NDArray[floataa]				      =			np.concatenate((coefficients, vector)	,axis=1    )
			lowerCAmelCase__ :    List[str]				      =			augmented_mat.astype('''float64'''    )

			# scale the matrix leaving it triangular
			for row in range(rows - 1    ):
						lowerCAmelCase__ :    str				      =			augmented_mat[row, row]
						for col in range(row + 1	,__UpperCamelCase    ):
									lowerCAmelCase__ :    Optional[int]				      =			augmented_mat[col, row] / pivot
									augmented_mat[col, :] -= factor * augmented_mat[row, :]

			lowerCAmelCase__ :    int				      =			retroactive_resolution(
			    augmented_mat[:, 0:columns]	,augmented_mat[:, columns : columns + 1]    )

			return x


if __name__ == "__main__":
							import doctest

							doctest.testmod()



