Skip to content

Implement Levenshtein Distance #8

@saurabh47

Description

@saurabh47

Write a function that takes in two strings and returns the minimum number of edit operations that need to be performed on the first string to obtain the second string.

There are three edit operations: insertion of a character, deletion of a character, and substitution of a character for another.

Sample Input

str1 = "abc"
str2 = "yabd"

Sample Output

2 // insert "y"; substitute "c" for "d"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions