Minimum ASCII Delete Sum for Two Strings
Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal.
Examples
Input: ["sea","eat"]
Output: 231
Input: ["delete","leet"]
Output: 403
Hints
Consider using a 2D dynamic programming table where `dp[i][j]` represents the minimum ASCII sum of deleted characters to make `s1[0..i-1]` and `s2[0..j-1]` equal.
Initialize the DP table with base cases: `dp[i][0]` is the sum of ASCII values of the first `i` characters of `s1`, and `dp[0][j]` is the sum of ASCII values of the first `j` characters of `s2`.
For each character in `s1` and `s2`, if the characters match (`s1[i-1] == s2[j-1]`), carry forward the value from the diagonal (`dp[i-1][j-1]`). Otherwise, take the minimum of deleting the current character from `s1` or `s2` and add its ASCII value to the result.
Minimum ASCII Delete Sum for Two Strings
Given two strings `s1` and `s2`, return the lowest **ASCII sum** of deleted characters to make two strings equal.