Problem 2565 · Hard

Subsequence With the Minimum Score

Remove one contiguous span of t so the rest is a subsequence of s. A prefix match from the left and a suffix match from the right meet at the cheapest cut.

Open the interactive visualisation