Mark As Completed Discussion

The Column for Letter "S"

Having filled the columns for B and E, let's now move on to the column for the letter S from the string best.

Calculating the Costs for "S"

Starting with S and T, we find that the two letters are different, so the edit cost is 1. The calculations for this cell are:

  1. From Above: (2 + 1 = 3)
  2. From the Left: (2 + 1 = 3)
  3. From the Diagonal: (2 + 1 = 3)

The minimum of these is 3, so we place it in the cell where S intersects with T.

The Updated Matrix with "S" Column Filled

Here's how our matrix looks after filling in the "S" column:

beSt
01234
T1123
e2212
s3321
t4432

With the column for S filled in, we're getting closer to completing our matrix. We would continue this step-by-step approach for the remaining columns to determine the final edit distance between the two strings.