Edit Distance by DP

how the insert, remove and replace functions are working, link -https://ide.codingblocks.com/s/226166

@Codemaniac_Aditya
You are at the m’th and n’th character.

if you take remove operation, you removed m’th character so you solve for (m-1,n);
if you take insert operation, you inserted a m’th character equal to n’th character, so you solve (m,n-1) [remaining characters are [:m] and [:n-1] ]
if you replace m’th and n’th character, then it you solve for(m-1,n-1).

1 Like