All Submissions


You have to obtain the second string from the first. There are three allowed operations but they do not have equal costs.
1. Insertion (Cost = 2)
2. Deletion (Cost = 1)
3. Replacement (Cost = 1)


Input Specification
Each test case consists of two lines. Both lines begin with a number denoting the length of the string that follows. Input ends with EOF.

Output Specification
Display a single number for every test case denoting the Edit Distance according the rules given above.

Sample Input
10 AGTCTGACGC
11 AGTAAGTAGGC
1 A
2 AA

Sample Output
5
2

Sample Output
Length of each string <= 100

Problem Setter : Shikhar Sharad
Problem Tester : Dhruva Bhaswar

Languages: Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Ruby,Text

Time Limit: 1 Second(s)
Score: 0 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0