Problem 1032. compare strings
Given 2 strings and 3 actions (Insert,delete,replace) on characters. Find the difference between two strings.
Example:
string1 = 'spring'
string2 = 'strange'
replace(p,t), replace(i,a), insert(e) = 3 actions = 3 differences
so the answer is 3
Solution Stats
Problem Comments
-
1 Comment
Check out Cody Problem 93: Calculate the Levenshtein distance between two strings for other solutions to this problem.
http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-distance-between-two-strings
Solution Comments
Show commentsProblem Recent Solvers32
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15757 Solvers
-
128 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2797 Solvers
-
Find the "ordinary" or Euclidean distance between A and Z
171 Solvers
-
Split a string into chunks of specified length
2024 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!