EDIST - Edit distance
You are given two strings, A and B. Answer, what is the smallest number of operations you need to
transform A to B?
Operations are:
- Delete one letter from one of strings
- Insert one letter into one of strings
- Replace one of letters from one of strings with another letter
Input
T - number of test cases
For each test case:
- String A
- String B
Both strings will contain only uppercase characters and they won't be longer than 2000 characters.
There will be 10 test cases in data set.
Output
For each test case, one line, minimum number of operations.
Example
Input: 1 FOOD MONEY Output: 4
hide comments
Harish Reddy Kolanu:
2015-04-04 09:51:36
try using WagnerâFischer algorithm
|
|
Abhay Jain:
2015-03-21 12:52:32
Can somebody help. Its showing SIGSEGV error. Please help out.
|
|
Arjun Verma:
2015-03-17 18:10:03
2d array accepted with global + static int
|
|
gratitude:
2015-02-27 18:31:14
should use dp or else tle :) |
|
Daniel Carvalho:
2015-02-17 16:36:23
Sigsev for 2D array and non-global variables. Works with 1D and global. |
|
Tejwinder Singh:
2015-02-16 17:17:04
I am frustated
|
|
Andrey Kaygorodov:
2015-02-06 20:03:28
@shankar should be 4 |
|
shankar:
2015-02-04 19:31:21
what should be the answer for
|
|
Anubhav Gupta:
2015-02-04 01:32:40
Levenshtein distance |
|
Abhay:
2015-01-23 13:08:24
Can someone provide me some sample test cases? The judge is giving me WA but I have been correct in all the examples I have tried.
|
Added by: | Mislav Balunović |
Date: | 2010-02-28 |
Time limit: | 15s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS OBJC PERL6 SQLITE VB.NET |
Resource: | Internet |