We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Well, maximum is actually infinite, since you can always append a character, delete a character, append a character, delete a character, repeat...
(s.length() - i) + (t.length() - i) is actually how many operations you need to solve the problem, while ignoring the add/delete of same character, which does nothing.
Append and Delete
You are viewing a single comment's thread. Return to all comments →
Well, maximum is actually infinite, since you can always append a character, delete a character, append a character, delete a character, repeat...
(s.length() - i) + (t.length() - i)
is actually how many operations you need to solve the problem, while ignoring the add/delete of same character, which does nothing.HackerRank solutions.