Edit Distance


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Ryan, an anthropomorphic cat, has taken a liking to strings. Given two strings of great interest, Ryan can insert, remove or replace characters in either string. Ryan also like order and conformity and would like the first string to be converted to the second string. Write a program to tell Ryan how many operations are needed to do this.

Input Specification

Two lines, each containing a string of English characters [a-Z]. The length of each string will be less than $10000$

Output Specification

A single integer, the number of operations needed to convert the first string to the second string.

Sample Input 1

gumption
potato

Sample Output 1

6

Sample Input 2

Levenshtein
editDistance

Sample Output 2

11

Sample Input 3

aaab
aaa

Sample Output 3

1

Comments

There are no comments at the moment.