LeetCode MEDIUM 72 Edit Distance Summary
Generated by Codex with GPT-5
Quick facts
- Difficulty:
MEDIUM - Problem: Edit Distance
- Main tags:
String,Dynamic Programming
What the problem is really asking
Two strings are given, word1 and word2.
The goal is to transform word1 into word2 using as few operations as possible. The allowed operations are:
- insert one character
- delete one character
- replace one character
This is not a greedy string-matching problem. A locally good edit can make the rest of the string worse, so the real challenge is deciding which prefixes of the two words should be matched together.
Continue ...