public boolean isMatch2(String s, String p) {
		// Start typing your Java solution below
		// DO NOT write main() function
		if (p == null)
			return s == null;

		if (s == null)
			return false;

		if (p.length() == 0)
			return s.length() == 0;

		if (p.charAt(0) != '*') {
			if (s.length() > 0
					&& (s.charAt(0) == p.charAt(0) || p.charAt(0) == '?'))
				return isMatch(s.substring(1), p.substring(1));
			else
				return false;
		}

		int i = 0;
		for (; i < s.length(); i++) {
			if (isMatch(s.substring(i), p.substring(1)))
				return true;
		}

		return isMatch(s.substring(i), p.substring(1));
	}