I got the exact same result with the expected answer but I still get wrong answer for the unitest. How should I fix it?


image
image

How should I fix the unitest incorrect result?

Hi.

Pay attention when you assign values to your first row and first column - it should reflect the delete and insert costs - 0,2,4 … instead of 0,1,2 - this is why your “Distance matrix has wrong values”.

1 Like

Can you please let me know why they should be 0,2,4,6,8,10 instead of 0,1,2,3,4,5, because the delete and insert cost is 1?

Oh, sorry. When you call the function min_edit_distance( ..ins_cost = 2, del_cost = 2, ..) - with different parameters (not default) it should account for them

1 Like

Thank you so much!!!
I figured it OUT!!!