Problem 3135 · Medium

Equalize Strings by Adding or Removing Characters at Ends

Trim both strings down to a shared contiguous piece; the table of matching runs finds the longest one and the cost follows.

Open the interactive visualisation