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
BOOM BOOM !
can't we use maps?
Use bottom-up approach,it will not give TLE.
can a input string be empty
aaj se meri saari galliyan teri ho gayi aaj se mera ghar tera ho gya tere kandhe ka jo til hai tere sine mein jo dil hai teri bijli ka jo bill hai aaj se mera ho gya tere khabo ka ambar teri khushiyo ka samandar ter pin code ka number aaj se mera ho gya
To Solve This Using Wagner–Fischer algorithm.
It's possible to AC with Py3 here (https://www.spoj.com/ranks/EDIST/lang=PYTH%203.2.3) but with problems like this is always gonna be hard. Submit your code in PyPy.
I am getting TLE in all the approaches in python3. Is there anyone who got AC in python3?
Just use cin instead of getline.I have solved many problem where getline doesn't work but cin does.Mayber they have used space to separate int the test case.
cin.get() gives WA while scanf gives AC. What is the reason?