Problem of the day
1. Delete a character
2. Replace a character with another one
3. Insert a character
Strings don't contain spaces in between.
The first line of input contains the string 'S' of length 'N'.
The second line of the input contains the String 'T' of length 'M'.
The only line of output prints the minimum "Edit Distance" between the strings.
You do not need to print anything; it has already been taken care of. Just implement the given functions.
0 <= N <= 10 ^ 3
0 <= M <= 10 ^ 3
Time Limit : 1sec
abc
dc
2
In 2 operations we can make the string T to look like string S. First, insert the character 'a' to string T, which makes it "adc".
And secondly, replace the character 'd' of the string T with 'b' from the string S. This would make string T to "abc" which is also the string S. Hence, the minimum distance.
whgtdwhgtdg
aswcfg
9