7553: [CSES Problem Set] Edit Distance
[Creator : ]
Description
The edit distance between two strings is the minimum number of operations required to transform one string into the other.
The allowed operations are:
Your task is to calculate the edit distance between two strings.
The allowed operations are:
-
Add one character to the string.
-
Remove one character from the string.
-
Replace one character in the string.
Your task is to calculate the edit distance between two strings.
Input
The first input line has a string that contains $n$ characters between A–Z.
The second input line has a string that contains $m$ characters between A–Z.
The second input line has a string that contains $m$ characters between A–Z.
Output
Print one integer: the edit distance between the strings.
Constraints
$1≤n,m≤5000$
Sample 1 Input
LOVE
MOVIE
Sample 1 Output
2