Sir I am unable to understand why am I getting runtime error?
Edit Distance 2D DP
Hey @pangatt4
Please share your code in Coding Blocks IDE
- GO to https://ide.codingblocks.com/
- Paste ur code
- Press Ctrl+S and click on save
- Paste the url here
Link to code, Edit Distance:
Hey @pangatt4
if(i1 > l1)
return s2.length()-i2; //updated
if(i2 > l2)
return s1.length()-i1; //updated
1 Like
Okay, I understood that logic. But as I created dp[][] with dimention as largest of both strings, then also it gave segmentation fault. That should have worked, don’t know why?
Yeah wasn’t able to figure out the issue
try to dry run for
a
b