Edit Distance
Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. Operations: insert, delete, or replace a character.
Edit Distance

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. Operations: insert, delete, or replace a character.

Example 1:
Input: {"word1":"horse","word2":"ros"}
Output: 3
Input
arr ={"word1":"horse","word2":"ros"}

Initialize DP table

ros0000h0000o0000r0000s0000e0000
Variables
VariableValue
m5
n3
DepthFunction Call
Stack empty
0/17