public boolean isMatch(String s, String p) {

        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < p.length(); ++i){
            if(p.charAt(i) != '*') sb.append(p.charAt(i));
            else {
                if(i == 0 || i > 0 && p.charAt(i-1) != '?'){
                    sb.append("?*");
                }else{
                    sb.append("*");
                }
            }
        }

       return isMatchRec(s, sb.toString());
    }