I am getting the error pls wtell me where i am wrong

ide:-https://ide.geeksforgeeks.org/Ymcr3DNjNt

Hey size of string can be 2000, increase your dp size. If that doesn’t work. Change your recurrence relation to this

dp[e1][e2]=min(1+CalculateEditDistance(word1,word2,e1,e2-1),min(1+CalculateEditDistance(word1,word2,e1-1,e2-1),1+CalculateEditDistance(word1,word2,e1-1,e2)));

Here e1 and e2 are the length of string 1 & 2 respectively

Can you please explain what is wrong in my recurrece relation bcz i thought it would be the correct relation’

Check now ->


Your recurrence relation is right, your code was just taking a lot of time. Have edited that, by improvising your code.

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.