Edit Distance (Levenshtein)

00:00
HardDynamic ProgrammingStringLCS
AmazonGoogleMicrosoft

Find the minimum number of operations (insert, delete, replace) to convert string s into string t.

Examples

Input → s='horse', t='ros'
Output → 3
Note: horse→rorse→rose→ros
Input → s='intention', t='execution'
Output → 5
Input → s='', t='abc'
Output → 3
Note: 3 inserts