* Backtrack the LCS table to produce edit operations. * Returns an array of { type, aIdx, bIdx } entries.
| 64 | * Returns an array of { type, aIdx, bIdx } entries. |
| 65 | */ |
| 66 | interface EditOp { |
| 67 | type: "equal" | "delete" | "insert" |
| 68 | aIdx: number // index in a (-1 for insert) |
| 69 | bIdx: number // index in b (-1 for delete) |
| 70 | } |
| 71 | |
| 72 | function backtrackLCS(a: string[], b: string[], dp: number[][]): EditOp[] { |
| 73 | const ops: EditOp[] = [] |
nothing calls this directly
no outgoing calls
no test coverage detected