Java -- Fast Memoization DP -- with Comments
```\nclass Solution {\n    \n    int[][] memo; // 0 indicates haven\'t found, -1 is not possible, 1 is possible!\n    \n    public boolean isMatch(String s, Str
```\nclass Solution {\n    \n    int[][] memo; // 0 indicates haven\'t found, -1 is not possible, 1 is possible!\n    \n    public boolean isMatch(String s, String p) {\n        memo = new int[s.length() + 1][p.length() + 1];\n        return dfs(s, p, 0, 0);\n    }\n    \n    public boolean dfs(String s, String p, int p1, int p2) {\n        \n        // let\'s check if \n        if (p1 == s.length()) {\n            \n            // keep advancing the star characters!\n            while (p2 < p.length() && p.charAt(p2) == \'*\')\n                p2++;\n            \n            // did we get to the end?\n            if (p2 == p.length()) {\n                memo[p1][p2] = 1;\n                return true;\n            }\n            \n            memo[p1][p2] = -1;\n            return false;\n        // still have characters left!\n        } else if (p2 == p.length()) {\n            memo[p1][p2] = -1;\n            return false;\n        }\n        \n        if (memo[p1][p2] == -1)\n            return false;\n        \n        if (memo[p1][p2] == 1)\n            return true;\n        \n        boolean possible = false;\n        \n        if (p.charAt(p2) == \'?\')\n            possible = dfs(s, p, p1 + 1, p2 + 1);\n        else if (p.charAt(p2) == \'*\') {\n            // useless starting * (match zero), matches more than one character character, matches this exact character\n            possible = dfs(s, p, p1, p2 + 1) || dfs(s, p, p1 + 1, p2) || dfs(s, p, p1 + 1, p2 + 1);\n        }     \n        else\n            if (s.charAt(p1) == p.charAt(p2))\n                possible = dfs(s, p, p1 + 1, p2 + 1);\n        \n        memo[p1][p2] = possible ? 1 : -1;\n        return possible;\n    }\n}
['Dynamic Programming', 'Memoization', 'Java']