Edit Distance
Fewest single-character insertions, deletions and replacements turning one string into another.
The edit distance between two strings is the minimum number of operations required to transform one string into the other.
The allowed operations are:
- Add one character to the string.
- Remove one character from the string.
- Replace one character in the string.
For example, the edit distance between LOVE and MOVIE is 2, because you can first replace L with M, and then add I.
Your task is to calculate the edit distance between two strings.
Input
The first input line has a string that contains characters between A–Z.
The second input line has a string that contains characters between A–Z.
Output
Print one integer: the edit distance between the strings.
Constraints
Example
Input:
LOVE MOVIE
Output:
2
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/EditDistance/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions21 qualifying submissions. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
21 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 1.000 | 5,967,373,900 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-24 01:37 UTC |
| 2 | lukerj00 | 0.976 | 6,840,316,049 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-21 23:22 UTC |
| 3 | lukerj00 | 0.966 | 6,840,475,731 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-24 06:24 UTC |
| 4 | lukerj00 | 0.961 | 7,422,214,460 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-24 04:51 UTC |
| 5 | lukerj00 | 0.958 | 7,567,786,773 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-22 22:02 UTC |
| 6 | lukerj00 | 0.955 | 7,422,225,638 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-23 23:53 UTC |
| 7 | lukerj00 | 0.954 | 7,422,856,884 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-23 02:21 UTC |
| 8 | lukerj00 | 0.953 | 6,986,399,760 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-23 04:44 UTC |
| 9 | lukerj00 | 0.945 | 7,713,962,353 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-21 23:08 UTC |
| 10 | lukerj00 | 0.935 | 7,841,565,896 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-24 10:23 UTC |
| 11 | lukerj00 | 0.928 | 8,345,527,384 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-23 06:03 UTC |
| 12 | lukerj00 | 0.924 | 8,586,678,686 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-22 22:42 UTC |
| 13 | lukerj00 | 0.915 | 8,732,600,215 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 21:15 UTC |
| 14 | lukerj00 | 0.915 | 8,999,161,059 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-24 00:57 UTC |
| 15 | lukerj00 | 0.914 | 9,151,095,853 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-23 00:06 UTC |
| 16 | lukerj00 | 0.901 | 9,895,978,870 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-24 03:58 UTC |
| 17 | lukerj00 | 0.899 | 10,187,117,432 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-23 11:43 UTC |
| 18 | lukerj00 | 0.887 | 9,460,708,919 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 20:00 UTC |
| 19 | lukerj00 | 0.880 | 9,752,162,818 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-21 20:47 UTC |
| 20 | lukerj00 | 0.869 | 10,189,098,813 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-24 01:01 UTC |
| 21 | lukerj00 | 0.773 | 18,627,785,360 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-23 22:19 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.