

def 		UpperCamelCase_(    snake_case__:						List[str]						,					snake_case__:						List[Any]     ) ->				Dict:


 if len(_A     ) < len(_A     ):
  return levenshtein_distance(_A						,					_A     )

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

 UpperCAmelCase__           =       list(range(len(_A     ) + 1     )     )

 for i, ca in enumerate(_A     ):
  UpperCAmelCase__           =       [i + 1]

  for j, ca in enumerate(_A     ):
   # Calculate insertions, deletions and substitutions
   UpperCAmelCase__           =       previous_row[j + 1] + 1
   UpperCAmelCase__           =       current_row[j] + 1
   UpperCAmelCase__           =       previous_row[j] + (ca != ca)

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

  # Store the previous row
  UpperCAmelCase__           =       current_row

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


if __name__ == "__main__":
 _UpperCamelCase     =    input('''Enter the first word:\n''').strip()
 _UpperCamelCase     =    input('''Enter the second word:\n''').strip()

 _UpperCamelCase     =    levenshtein_distance(first_word, second_word)
 print(F"""Levenshtein distance between {first_word} and {second_word} is {result}""")






from __future__ import annotations



class 					lowercase		:



 '''simple docstring'''


 def __init__(self , __a				)				->      None:






  """simple docstring"""





  UpperCAmelCase__           =       vertices
  UpperCAmelCase__           =       [[0] * vertices for _ in range(__a				)]




 def 						UpperCamelCase__							(self , __a				)				->      None:






  """simple docstring"""





  print('Vertex \t Distance from Source'				)
  for vertex in range(self.vertices				):
   print(__a , '\t\t' , distances_from_source[vertex]				)




 def 						UpperCamelCase__							(self , __a , __a				)				->      int:






  """simple docstring"""





  UpperCAmelCase__           =       1E7
  UpperCAmelCase__           =       0

  # Search not nearest vertex not in the shortest path tree
  for vertex in range(self.vertices				):
   if distances_from_source[vertex] < minimum and visited[vertex] is False:
    UpperCAmelCase__           =       distances_from_source[vertex]
    UpperCAmelCase__           =       vertex
  return min_index




 def 						UpperCamelCase__							(self , __a				)				->      None:






  """simple docstring"""





  UpperCAmelCase__           =       [int(1E7				)] * self.vertices  # distances from the source
  UpperCAmelCase__           =       0
  UpperCAmelCase__           =       [False] * self.vertices

  for _ in range(self.vertices				):
   UpperCAmelCase__           =       self.minimum_distance(__a , __a				)
   UpperCAmelCase__           =       True

   # Update dist value of the adjacent vertices
   # of the picked vertex only if the current
   # distance is greater than new distance and
   # the vertex in not in the shortest path tree
   for v in range(self.vertices				):
    if (
        self.graph[u][v] > 0
        and visited[v] is False
        and distances[v] > distances[u] + self.graph[u][v]
    ):
     UpperCAmelCase__           =       distances[u] + self.graph[u][v]

  self.print_solution(__a				)


if __name__ == "__main__":
 _UpperCamelCase     =    Graph(9)
 _UpperCamelCase     =    [
     [0, 4, 0, 0, 0, 0, 0, 8, 0],
     [4, 0, 8, 0, 0, 0, 0, 11, 0],
     [0, 8, 0, 7, 0, 4, 0, 0, 2],
     [0, 0, 7, 0, 9, 14, 0, 0, 0],
     [0, 0, 0, 9, 0, 10, 0, 0, 0],
     [0, 0, 4, 14, 10, 0, 2, 0, 0],
     [0, 0, 0, 0, 0, 2, 0, 1, 6],
     [8, 11, 0, 0, 0, 0, 1, 0, 7],
     [0, 0, 2, 0, 0, 0, 6, 7, 0],
 ]
 graph.dijkstra(0)



