If characters are equal , execute recursive function for n - 1 , m - 1
INDENT if ( s1 [ n - 1 ] == s2 [ m - 1 ] ) : NEW_LINE INDENT if ( dp [ n - 1 ] [ m - 1 ] == - 1 ) : NEW_LINE INDENT dp [ n ] [ m ] = minDis ( s1 , s2 , n - 1 , m - 1 , dp ) NEW_LINE return dp [ n ] [ m ] NEW_LINE DEDENT else : NEW_LINE INDENT dp [ n ] [ m ] = dp [ n - 1 ] [ m - 1 ] NEW_LINE return dp [ n ] [ m ] NEW_LINE DEDENT DEDENT DEDENT