Share my straight forward DP java code. O(N^2) complexity.
class Solution {\n        public boolean isMatch(String s, String p) {\n            //little trick here to avoid checking some corner cases\n            return 
    class Solution {\n        public boolean isMatch(String s, String p) {\n            //little trick here to avoid checking some corner cases\n            return _isMatch("a" + s, "a" + p);\n        }\n        public boolean _isMatch(String s, String p) {\n            boolean[][] valid = new boolean[p.length()][s.length()];\n            valid[0][0] = true;\n            for(int i = 1; i < p.length(); ++i){  \t\n                valid[i][0] = p.charAt(i) == '*' && valid[i-1][0];\n            }\n            for(int j = 1; j < s.length(); ++j){\n                valid[0][j] = false;\n            }\n            for(int i = 1; i < p.length(); ++i){\n                for(int j = 1; j < s.length(); ++j){\n                    if(p.charAt(i) == '*'){\n                        valid[i][j] = valid[i-1][j] || valid[i-1][j-1] || valid[i][j-1];\n                    }else if( p.charAt(i) == '?'){\n                        valid[i][j] = valid[i-1][j-1];\n                    }else{\n                        valid[i][j] = valid[i-1][j-1] && p.charAt(i) == s.charAt(j);\n                    }\n                }\n            }\n            return valid[p.length()-1][s.length()-1];\n        }\n    }
[]