3135. Equalize Strings by Adding or Removing Characters at Ends
Given two strings
initial
andtarget
, your task is to modifyinitial
by performing a series of operations to make it equal totarget
.In one operation, you can add or remove one character only at the beginning or the end of the string
initial
.Return the minimum number of operations required to transform
initial
intotarget
.
1 | class Solution { |