package leetcode;

/**
 * https://leetcode.com/problems/wildcard-matching/
 */
public class Problem44 {
    public boolean isMatch(String s, String p) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem44 prob = new Problem44();
        System.out.println(prob.isMatch("aa", "a")); // false
        System.out.println(prob.isMatch("aa", "*")); // true
        System.out.println(prob.isMatch("cb", "?a")); // false
        System.out.println(prob.isMatch("adceb", "*a*b")); // true
        System.out.println(prob.isMatch("acdcb", "a*c?b")); // false
        System.out.println(prob.isMatch("acdcb", "a*c?b")); // false
        System.out.println(prob.isMatch("aabc", "a*?c")); // true
    }
}

@@ -158,36 +158,684 @@
     
-// TODO%0A        return false
+return isMatch(s, p, 0, 0);%0A    %7D%0A%0A    private static boolean isMatch(String s, String p, int i, int j) %7B%0A        if (i == s.length() && j == p.length()) %7B%0A            return true;%0A        %7D else if (i == s.length()) %7B%0A            return false;%0A        %7D else if (j == p.length()) %7B%0A            return false;%0A        %7D%0A        boolean match = false;%0A        if (p.charAt(j) == '?' %7C%7C s.charAt(i) == p.charAt(j)) %7B%0A            match = isMatch(s, p, i + 1, j + 1);%0A        %7D else if (p.charAt(j) == '*') %7B%0A            match %7C= isMatch(s, p, i + 1, j);%0A            match %7C= isMatch(s, p, i, j + 1);%0A            match %7C= isMatch(s, p, i + 1, j + 1);%0A        %7D%0A        return match
 ;%0A  
@@ -926,16 +926,18 @@
 em44();%0A
+//
         
@@ -982,32 +982,34 @@
 %22a%22)); // false%0A
+//
         System.o
@@ -1045,32 +1045,34 @@
  %22*%22)); // true%0A
+//
         System.o
@@ -1110,32 +1110,34 @@
 ?a%22)); // false%0A
+//
         System.o
@@ -1183,24 +1183,26 @@
 )); // true%0A
+//
         Syst
@@ -1250,32 +1250,34 @@
 ?b%22)); // false%0A
+//
         System.o
@@ -1329,16 +1329,18 @@
 / false%0A
+//
         
@@ -1397,16 +1397,82 @@
 // true%0A
+        System.out.println(prob.isMatch(%22abc%22, %22*abc*%22)); // true%0A
     %7D%0A%7D%0A

Update problem 44