~/boss / word-smith

Edit distance (dynamic programming)

The Word Duel

Turn KITTEN into SITTING in the fewest edits. Fill the grid, then replay the moves.

Loading the fight…

How to beat it

One word down the side, the other across the top. Each cell is the fewest edits between those two starts. Same letter? Copy the diagonal for free. Different? 1 + the cheapest of replace (diagonal), delete (up) and insert (left). The bottom-right corner is the answer; walk back from it to find the edits.

Now the real boss

Interviews ask for the code. Watch it run, then write it yourself, tested in Python, C++ or Java.

On your phone? Writing code is easier on a laptop: open bossfight.dev/problems/edit-distance there. Sign in with your email to keep your progress on every device.

More bosses

esc