- Wrong base case initialization: First row/column often needs special handling. Think about empty string or starting position meaning.
- Index confusion: dp[i][j] might represent characters to , not to .
Be consistent with your indexing convention.
- Not considering all transitions: In edit distance, forgetting one operation type leads to wrong minimum.
- Space optimization breaks reconstruction: If you need the actual sequence (not just length), maintain full table or parent pointers.