A string, consisting of I, D, R, that describes a transformation of one string to another is called an edit transcript. Here R stands for replacement or substitution, I for insertion, and D for deletion. Note this is just one way to transform the first string to the second string. There are many other sequences of operations that give the same result. We use dynamic programming to solve this problem.
Dynamic programming solves problems by combining the solutions of subproblems.
The subproblems are further divided into subproblems, many of which are shared. So it solves every subproblem just once and then saves its answer in a table, thereby avoiding the work of recomputing the answer every time the subproblem is encountered. The way to fill in the table is row by row and from left to right. If we only care how the last character from each string aligned. That is E in the first string could be aligned with T in the second string, E could be aligned with a space in the second string or a space in the first string could be aligned with T in the second string.