For the "word transform" round, players must compute the minimum number of edits needed to turn one word into another. Given two strings A and B, print the minimum number of insertions, deletions, or substitutions needed to convert A into B.
Input
Two strings A and B on two lines.
Output
Minimum edit distance.
Constraints
1 ≤ |A|,|B| ≤ 2000
Sample Input
horse ros
Sample Output
3
main.c
Loading editor…
Write C, then Run (custom I/O) or Submit (sample tests). ⌘/Ctrl+Enter submits.