package leetcode;

/**
 * https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/
 */
public class Problem712 {
    public int minimumDeleteSum(String s1, String s2) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem712 prob = new Problem712();
        System.out.println(prob.minimumDeleteSum("sea", "eat")); // 231
        System.out.println(prob.minimumDeleteSum("delete", "leet")); // 403
    }
}

@@ -208,17 +208,734 @@
  return 
-0
+minimumDeleteSum(s1, s2, s1.length(), s2.length());%0A    %7D%0A%0A    private static int minimumDeleteSum(String s1, String s2, int i, int j) %7B%0A        if (i == 0) %7B%0A            return j;%0A        %7D%0A        if (j == 0) %7B%0A            return i;%0A        %7D%0A        if (s1.charAt(i - 1) == s2.charAt(j - 1)) %7B%0A            return minimumDeleteSum(s1, s2, i - 1, j - 1);%0A        %7D%0A        int ival = 0;%0A        if (i %3C s1.length()) %7B%0A            ival = s1.charAt(i);%0A        %7D%0A        int jval = 0;%0A        if (j %3C s2.length()) %7B%0A            jval = s2.charAt(j);%0A        %7D%0A        int a = minimumDeleteSum(s1, s2, i, j - 1);%0A        int b = minimumDeleteSum(s1, s2, i - 1, j);%0A        int min = 1 + Math.min(a, b);%0A        return min
 ;%0A    %7D%0A

Update problem 712