public boolean isMatch(String s, String p) {
		boolean[] F = new boolean[p.length() + 1];
		F[0] = true;
		for (int j = 1; j <= p.length(); j++) {
			F[j] = F[j - 1] && p.charAt(j - 1) == '*';
		}
		boolean last = false;
		for (int i = 1; i <= s.length(); i++) {
			boolean[] tmp = new boolean[p.length() + 1];
			for (int j = 1; j <= p.length(); j++) {
				if (p.charAt(j - 1) == '?' || (s.charAt(i - 1) == p.charAt(j - 1)))
					tmp[j] = F[j - 1];
				else if (p.charAt(j - 1) == '*')
					tmp[j] = F[j - 1] || last || F[j];
				last = tmp[j];
			}
			F = tmp;
		}
		return F[p.length()];
	}