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?
- 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
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.
For each test case, one line, minimum number of operations.
Input: 1 FOOD MONEY Output: 4
Top down with memo gave TLE. (maybe im not using memo correctly)
Need some test cases ! Please help !
Last edit: 2015-06-02 08:53:03
Finally done...:) First Dp... ;)
use global variables and dynamic matrix got AC :p
dp or else TLE!!!!!
can letters be inserted only at the end, or at the beginning and the end or anywhere in the word?
Those who all are getting SIGSEGV error try to define the variables globally that might help!!!
no need of an array of length 3000...the constraints in the problem are correct
WA :) Can someone provide me some test cases please !!