why it is not giving the correct output on large values.
Edit distance .it is not giving the correct output on large strings
if(str2[i-1]==str1[j-1])
dp[i][j]=min(dp[i-1][j],min(dp[i][j-1],dp[i-1][j-1]));
Hey change this to:
if(str1[i-1]==str2[j-1])
dp[i][j]=dp[i-1][j-1];
Did you get it why? let me know if you did not
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.