python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
def editDistance(str1, str2, m, n): if m == 0: return n if n == 0: return m if srt1[m-1] == str2[n-1]: return editDistance(str1, str2, m-1, n-1) return 1 + min(editDistance(str1, str2,m, n-1), editDistance(str1, str2,m-1, n), editDistance(str1, str2, m-1, n-1) ) str1 = "devil" str2 = "device" print (editDistance(str1, str2, len(str1), len(str2)))
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up