You have three operations at each step:
1. Insert: Add a character to A. Moves from (i,j) to (i,j−1) in DP (you matched B[j] by inserting).
2. Delete: Remove a character from A. Moves from (i,j) to (i−1,j) (discarded A[i]).
3. Replace: Change a character in A. Moves from (i,j) to (i−1,j−1) (aligned A[i] with B[j]). Each operation costs 1. If characters match, no operation needed.