Edit distance: Return the minimum number of single-character insertions, deletions, and replacements required to transform string a into string b.
Input: A JSON object { "a": string, "b": string }.
Output: A JSON integer.
Constraints:
- 0 <= a.length,b.length <= 2000
- Operations have equal cost
- Compare characters case-sensitively
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: HARD. Variant: 12. Favor a pragmatic solution that is easy to ship, read, and adapt.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked hard difficulty.
The signed-in workspace provides the tools required by the round, such as recording, code execution, diagrams, structured notes, or evidence panels. Attem