java two pointer solution
\nclass Solution {\n    public boolean isMatch(String s, String p) {\n        if (s.length() == 0 && p.length() == 0) return true;\n        int i = 0;\n        
```\nclass Solution {\n    public boolean isMatch(String s, String p) {\n        if (s.length() == 0 && p.length() == 0) return true;\n        int i = 0;\n        int j = 0;\n        int star = -1;\n        int match = 0;\n        while (i < s.length()) {\n            if (j < p.length() && (p.charAt(j) == s.charAt(i) || p.charAt(j) == \'?\')) {\n                i++;\n                j++;\n            }else if (j < p.length() && p.charAt(j) == \'*\') {\n                star = j;\n                match = i;\n                j++;\n            }else if (star != -1) {\n                j = star + 1;\n                match++;\n                i = match;\n            }else return false;\n        }\n        while (j < p.length() && p.charAt(j) == \'*\') j++;\n        return j == p.length();\n    }\n}\n```
[]