Problem with DP Solution, have not added the cost while replacing the string for variable q1?

In the DP Edit distance problem’s video , why haven’t you added 1 cost while replacing the string?


At 29:01

@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.