Minimum ASCII Delete Sum for Two Strings
Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make the two strings equal.
Example 1
Input
s1 = "sea", s2 = "eat"Output
231Deleting
s from sea adds 115 and deleting t from eat adds 116, for a minimum total of 231.Example 2
Input
s1 = "delete", s2 = "leet"Output
403Deleting
dee from delete and e from leet makes both strings equal to let with total cost 403, which is minimal.Constraints
- 1 <= s1.length, s2.length <= 1000
- s1 and s2 consist of lowercase English letters.