Problem 1320 · Hard

Minimum Distance to Type a Word Using Two Fingers

Memoize the cheapest way to finish the word, given where the other finger rests, by choosing which finger types each letter.

Open the interactive visualisation