Levenshtein Distance
Your client is a linguist with two lists of words, who wants to compare them to see how different each entry is from its counterpart.
The metric is Levenshtein Distance: the minimum number of single-character edits needed to turn one word into the other, where an edit removes a character, adds a character, or replaces a character. For example, "kitten" and "sitting" have a distance of 3: substitute k with s, substitute e with i, add g.
Produce the distance for each word pair, one row per input row. Words are lowercase and non-empty. The grader swaps in word lists of different lengths, so cover the whole OUTPUT range: empty input rows must produce empty output rows.
Work on it
- Make a copy of the template — it becomes your private sheet.
- Solve it however you like — helper columns and extra tabs are fair game. The one rule:
the grader swaps
INPUTfor other datasets, so never put your own content insideINPUT. - Check yourself against the expected sample output shown in your copy (and below).
- Submit below — Share → "anyone with the link, Viewer", paste the link. Your sheet is graded against 2 hidden datasets, so hardcoded answers won't survive.
Sample
Input (Input!B2:C18)
| Word 1 | Word 2 |
| kitten | sitting |
| saturday | sunday |
| flaw | lawn |
| same | same |
| abc | xyz |
| book | back |
Expected output (Answer!B3:B18)
| Distance |
|---|
| 3 |
| 3 |
| 2 |
| 0 |
| 3 |
| 2 |
Adapted from "Levenshtein Distance" in the astral.cafe Community Practice Problems sheet.