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

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

		int count = 1;
		while (count < p.length() && p.charAt(count) == '*')
			count++;

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

		return false;
	}