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
Declare all the variables as Global and the char array size must be >=2001.
no comment.... :P
AC in one go 0.17 s :D
Brilliant question, worth the 3 hours spent, learnt so much, a must for beginners like me.. You could refer to this link for help : ( https://www.youtube.com/watch?v=We3YDTzNXEk )
Beautiful DP problem!!
"those who are getting SIGSEGV fault declare 2-D dynamic array globally with size 3000.." -anuveshkothari is right
Can it be solved using LCS?
declaring char array globally instead of dynamic array costed in 3 segmentation error...
declare 2D array Globally if u are getting SIGSEGV fault