In the DP Edit distance problem’s video , why haven’t you added 1 cost while replacing the string?
At 29:01
In the DP Edit distance problem’s video , why haven’t you added 1 cost while replacing the string?
@piyushagru
The 1 cost is added in Line No. 22 if a substitution is required.
The condition (inp[i-1] != out[j-1]) is for that only.