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
my 1st dp..<3..AC after so many WA's..:D
AC in 4th GO!! -_- SIGSEGV wen declared locally...when array declared globally it accepts....why not locally???Last edit: 2016-05-21 07:48:43
Declare Arrays of size 2001 in c ..costed me INFINIT :( WA ...for declaring 2000 size character .. :--(
Bottom-up AC in a go!!
got AC using character array in top-down approach
Make the array global
Levenshtein Distance :)
I'm getting TLE in bottomup dp..No idea what's wrong.
Aqib Ahmed J:
AC in one go :) My 2nd DP problem :)
Hi guys, I am getting a WA if I use it in C++ strings... If do it using the char array in C it is being accepted....