| 1 | Initialize DP table | (0,0) | N/A | [[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]] | Set head pointer | Empty table with 7 rows and 8 columns |
| 2 | Fill first row | (0,j) | N/A | [[0,1,2,3,4,5,6,7],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]] | Move right along row 0 | First row filled with 0 to 7 |
| 3 | Fill first column | (i,0) | N/A | [[0,1,2,3,4,5,6,7],[1,0,0,0,0,0,0,0],[2,0,0,0,0,0,0,0],[3,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0]] | Move down along column 0 | First column filled with 0 to 6 |
| 4 | Compare chars | (1,1) | k vs s | [[0,1,2,3,4,5,6,7],[1,1,0,0,0,0,0,0],[2,0,0,0,0,0,0,0],[3,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0]] | Check diagonal (0), left (1), top (1) | Cell (1,1) set to 1 (min+1) |
| 5 | Compare chars | (1,2) | k vs i | [[0,1,2,3,4,5,6,7],[1,1,2,0,0,0,0,0],[2,0,0,0,0,0,0,0],[3,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0]] | Check diagonal (1), left (1), top (2) | Cell (1,2) set to 2 |
| 6 | Compare chars | (1,3) | k vs t | [[0,1,2,3,4,5,6,7],[1,1,2,3,0,0,0,0],[2,0,0,0,0,0,0,0],[3,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0]] | Check diagonal (2), left (2), top (3) | Cell (1,3) set to 3 |
| 7 | Compare chars | (2,1) | i vs s | [[0,1,2,3,4,5,6,7],[1,1,2,3,4,0,0,0],[2,2,0,0,0,0,0,0],[3,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0]] | Check diagonal (1), left (2), top (1) | Cell (2,1) set to 2 |
| 8 | Compare chars | (6,7) | n vs g | [[0,1,2,3,4,5,6,7],[1,1,2,3,4,5,6,7],[2,2,1,2,3,4,5,6],[3,3,2,1,2,3,4,5],[4,4,3,2,2,2,3,4],[5,5,4,3,3,3,2,3],[6,6,5,4,4,4,3,3]] | Check diagonal (2), left (3), top (3) | Cell (6,7) set to 3 |
| 9 | Final result | (6,7) | N/A | Final DP table as above | No pointer change | Minimum edits needed: 3 |