funcminDistance(word1 string, word2 string)int{
l1 :=len(word1)
l2 :=len(word2)
dp :=make([][]int, l1 +1)
dp[0]=make([]int, l2 +1)for j :=0; j <= l2; j++{
dp[0][j]= j
}for i :=1; i <= l1; i++{
dp[i]=make([]int, l2 +1)
dp[i][0]= i
for j :=1; j <= l2; j++{if word1[i-1: i]== word2[j-1:j]{
dp[i][j]= dp[i-1][j-1]}else{
dp[i][j]=MinThree(dp[i-1][j], dp[i][j-1], dp[i-1][j-1])+1}}}return dp[l1][l2]}funcMinThree(a, b, c int)int{var min intif a >= b {
min = b
}else{
min = a
}if min >= c{return c
}else{return min
}}